Android:控件的对象修改控件的值
16lz
2021-12-04
TextView
private TextView textView;...textView =(TextView)findViewById(R.id.textView);textView.setText("set text success");
控制:
<TextView android:id="@+id/textView" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="#ff0000" android:text="old text" />
ImageView
imageViewId1 =(ImageView)findViewById(R.id.imageViewId1); imageViewId1.setImageResource(R.drawable.logo_small); imageViewId1.setScaleType(ScaleType.CENTER);
<ImageView android:id="@+id/imageViewId1" android:layout_width="120dp" android:layout_height="120dp" android:src="@drawable/pic1" android:scaleType="fitXY" android:background="#ff0000" />
更多相关文章
- Android锁屏控制
- android 动态控制状态栏显示和隐藏的方法实例
- android ui 布局性能优化
- cocos2dx 移植android 报错
- Android(安卓)中Button点击频率的控制
- Android-- 输入法键盘控制
- Android开发问题记录——“The connection to adb is down...”
- Google Android真实的谎言
- cocos2d-x-2.1.4在NDK r9下的编译问题