如何取得 `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: `實作相關`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up