As the title says, I want to know if there is any way to control views inside the NavigationView header? (Except for adding or removing header.)
For exa
The other way to make this is using the method "inflateHeaderView()" of NavigationView object, like below (After using "setContentView()"):
View headerLayout = navigationView.inflateHeaderView(R.layout.yours_nav_header_layout);
After this point you can use "headerLayout" to access custom views in your header layout, like below:
View cutomView = (TextView) headerLayout.findViewById(R.id.lay_sign_in);
In my case i'm using ButterKnife framework to inject View "navigationView" like this:
@Bind(R.id.nav_view) NavigationView navigationView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
}