---
# System prepended metadata

title: '如何取得 `NavigationView` 裡面的 `app:headerLayout`'
tags: [實作相關]

---

如何取得 `NavigationView` 裡面的 `app:headerLayout`
===
```java=
// 取得 NavigationView
NavigationView navigationView = findViewById(R.id.your_nav_view);

// 取得 header
View header = navigationView.getHeaderView(0);

TextView textUsername = header.findViewById(R.id.textView);
textUsername.setText("you text here ");
```

## Ref.
[NavigationView get/find header layout](https://stackoverflow.com/questions/33194594/navigationview-get-find-header-layout)

###### tags: `實作相關`