Skip to content

Instantly share code, notes, and snippets.

@espritm
Created Mar 27, 2017
Embed
What would you like to do?
protected override void OnCreate(Bundle bundle)
{
//...
//Add a header view to the NavigationView
ConfigureNavigationViewHeader();
}
private void ConfigureNavigationViewHeader()
{
View viewHeader = LayoutInflater.Inflate(Resource.Layout.mainActivity_navigationView_header, null);
ImageView imageviewUserAvatar = viewHeader.FindViewById<ImageView>(Resource.Id.mainActivity_navigationView_header_imageview_userAvatar);
TextView textviewUserPseudo = viewHeader.FindViewById<TextView>(Resource.Id.mainActivity_navigationView_header_textview_UserPseudo);
TextView textviewUserDesc = viewHeader.FindViewById<TextView>(Resource.Id.mainActivity_navigationView_header_textview_UserDesc);
imageviewUserAvatar.SetImageResource(Resource.Drawable.photo_profil);
textviewUserPseudo.Text = "Maxime Esprit";
textviewUserDesc.Text = "A passionate mobile apps developer";
m_navigationView.AddHeaderView(viewHeader);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment