Android基本控件模板
16lz
2021-12-04
一:Button
<Button android:id="@+id/button_order" android:text="确认下单" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" />
二:ImageButton
<ImageButton android:id="@+id/l6" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/l6" />
三:ToggleButton
<ToggleButton android:id="@+id/button_toggle1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:checked="true" android:textOn="打开" android:textOff="关闭" />
四:TextView
<TextView android:id="@+id/myText"android:layout_height="36dip"android:layout_width="fill_parent"android:background="drawable/r1"android:textSize="25dip"android:text="OOO"android:layout_gravity="center"android:ellipsize="marquee"android:singleLine="true"android:focusable="true"android:marqueeRepeatLimit="marquee_forever"android:focusableInTouchMode="true"android:scrollHorizontally="ture" />
android:drawableLeft在文本左边添加图片,同理有Bottom、Top、Right、Padding等
android:ellipsize="marquee"设置使用跑马灯
android:singleLine="true" 是否单行显示
android:marqueeRepeatLimit="marquee_forever" 跑马灯显示次数
更多相关文章
- Logcat语法高亮显示:语法高亮显示为Android(安卓)Logcat文件
- Android(安卓)Adapter详解
- Android(安卓)TextView在XML中的属性
- ImageView的属性android:scaleType,即ImageView.setScaleType(Ima
- Android实现图片帮助跳转以及选择重拍Sqlite本地保存
- ImageView的scaletype属性
- PopupWindow 动画显示与消失(逐惭缩放、逐惭透明)
- Android下Dialog及Activity屏蔽Home键详解
- gallery 显示文字