基本控件使用
来源:互联网 发布:js 鼠标自动隐藏 编辑:程序博客网 时间:2024/06/04 22:02
一、TextView和EditText
<!-- wrap_content:包裹实际文本内容 match_parent:当前控件铺满父类容器 fill_parent:当前控件铺满父类容器 TextView常用属性 android:id ==控件id android:layout_width==控件的宽度 android:layout_height==控件的高度 android:text==文本内容 android:textSize==文本颜色 android:background==控件背景 EditText常用属性 TextView 属相+ android:hint==输入提示文本 android:inputType==输入文本类型 --> <EditText android:id="@+id/textView2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="" android:inputType="" android:text="@string/hello_world" /> <TextView android:id="@+id/textView2x" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello_world" />
通过id获得控件
tv=(TextView)this.findViewById(R.id.textView2x)设置字体颜色
tv.setText("设置内容");
tv.setTextColor(Color.RED)
android:inputType="phone"为设置输入格式为拨号键盘
二、ImageView
<!-- android:src==图片路径 @drawable/abc_ab_bottom_solid_dark_holo" android:background ==可以设置图片和颜色 @drawable/abc_ab_bottom_solid_dark_holo 和#dddddd --><ImageView android:src="@drawable/abc_ab_bottom_solid_dark_holo" android:background="#ffffff" />三、Button 和IMageButton
0 0
- webView控件基本使用
- 控件的基本使用
- NGUI基本控件使用
- IOS基本控件使用
- ExpandableListView控件基本使用
- 基本控件使用
- Android基本控件使用
- swift基本控件使用
- MFC 基本控件使用
- CStatic控件的基本使用
- CStatic控件的基本使用
- API编程基本控件使用
- CStatic控件的基本使用
- CStatic控件的基本使用
- CStatic控件的基本使用
- CStatic控件的基本使用
- CStatic控件的基本使用
- webView控件基本使用(android)
- JDBC(三)
- hdu 2833 WuKong(floyd变形)
- QQ侧滑效果的实现与思考
- 学习正则表达式,一看就懂
- Xcode莫名其妙的崩溃
- 基本控件使用
- Git 本地库与远程库的快速入门
- bzoj1069: [SCOI2007]最大土地面积
- JavaScript学习--Item21 漂移的this
- cron表达式详解
- MySQL InnoDB的存储结构总结
- Android与服务器端数据交互(基于SOAP协议android+webservice)
- __attribute__ 你知多少?
- Android Webview解决input事件