java Android `求这两句的意思 tabLayout = (LinearLayout) this.findViewById(R.id.TabLayout);tabLayout.setBackgroundDrawable(this.getResources().getDrawable(R.drawable.tab01));
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/25 08:10:45
![java Android `求这两句的意思 tabLayout = (LinearLayout) this.findViewById(R.id.TabLayout);tabLayout.setBackgroundDrawable(this.getResources().getDrawable(R.drawable.tab01));](/uploads/image/z/9970373-29-3.jpg?t=java+Android+%60%E6%B1%82%E8%BF%99%E4%B8%A4%E5%8F%A5%E7%9A%84%E6%84%8F%E6%80%9D+tabLayout+%3D+%28LinearLayout%29+this.findViewById%28R.id.TabLayout%29%3BtabLayout.setBackgroundDrawable%28this.getResources%28%29.getDrawable%28R.drawable.tab01%29%29%3B)
java Android `求这两句的意思 tabLayout = (LinearLayout) this.findViewById(R.id.TabLayout);tabLayout.setBackgroundDrawable(this.getResources().getDrawable(R.drawable.tab01));
java Android `求这两句的意思
tabLayout = (LinearLayout) this.findViewById(R.id.TabLayout);
tabLayout.setBackgroundDrawable(this.getResources().getDrawable(
R.drawable.tab01));
java Android `求这两句的意思 tabLayout = (LinearLayout) this.findViewById(R.id.TabLayout);tabLayout.setBackgroundDrawable(this.getResources().getDrawable(R.drawable.tab01));
tabLayout = (LinearLayout) this.findViewById(R.id.TabLayout);
这行代码就是根据视图的ID来获取控件对象.
你这行代码的话应该是你的布局文件中有个LinearLayout,它的android:id="@+id/TabLayout".
这样在Activity中通过Activity类的findViewById(R.id.TabLayout)获取次LinearLayout.
tabLayout.setBackgroundDrawable(this.getResources().getDrawable(
R.drawable.tab01));
这行代码就是设置你的布局的背景,就是一张图片.
图片是drawable目录下的tab01.