有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java使用NavigationView Xamarin

嗨,我对NavigationView有问题。我使用以下代码:

        nav = FindViewById<NavigationView>(Resource.Id.nav_view);
        View vie = nav.GetHeaderView(0);
        TextView title1 = vie.FindViewById<TextView>(Resource.Id.title1);
        TextView title2 = vie.FindViewById<TextView>(Resource.Id.title2);
        ImageView logo_menu = vie.FindViewById<ImageView>(Resource.Id.imageView1);
        title1.Text = MenuLayout.text1;
        title1.TextSize = MenuLayout.text1_size;
        title1.SetTextColor(MenuLayout.text1_color);
        title2.Text = MenuLayout.text2;
        title2.TextSize = MenuLayout.text2_size;
        title2.SetTextColor(MenuLayout.text2_color);
        logo_menu.SetImageBitmap(MenuLayout.menu_Image);
        vie.SetBackgroundColor(Android.Graphics.Color.Black);

最后一行行不通,没什么变化。。。如何以编程方式设置标题的背景?我的第二个问题是更改Navmenu的文本和图标项(程序工作时我可以更改吗?如何覆盖此项)


共 (0) 个答案