问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
SetContentView(Resource.Layout.activity_main);
// Create your application here
viewPapgeTitle = FindViewById<ViewPager>(Resource.Id.viewPager1);
viewLists = new List<View>();
LayoutInflater li = LayoutInflater;
viewLists.Add(li.Inflate(Resource.Layout.layout1, null, false));
viewLists.Add(li.Inflate(Resource.Layout.layout2, null, false));
viewLists.Add(li.Inflate(Resource.Layout.layout3, null, false));
titleList = new List<string>() {
"红褐色","黄色","白色"
};
adapter = new MyPagerAdapter2(viewLists, titleList);
viewPapgeTitle.Adapter = adapter;
////////////如何获取layout1布局下的button_layout1 按钮1
///////////////如何获取layout2布局下的button_layout2 按钮2
button_layout1 = FindViewById<Button>(Resource.Id.button_layout1);
button_layout2 = FindViewById<Button>(Resource.Id.button_layout2);
运行结果及报错内容
button_layout1 空 如何获取
我的解答思路和尝试过的方法
button_layout1 空 如何获取
我想要达到的结果
button_layout1 空 如何获取