1. 说明
下拉选框
2. 使用示例
<Spinner android:layout_height="wrap_parent"
android:layout_width="match_parent"
android:tag="btn"
android:text="选择1|选择2"
android:textColor="#669999"
android:textSize="14dp"
android:gravity="center"
/>
3. 属性说明
3.1. 公有属性
请参考 公有属性
3.2. 私有属性
属性名 | 说明 | 可选值 |
---|---|---|
layout_weight | 子元素权重 | 数字 当父级为LinearLayout的时候,子控件可以设置权重 |
gravity | 内部的控件对齐方式 | 用法参考 top bottom left right center_vertical fill_vertical center_horizontal fill_horizontal center fill clip_vertical clip_horizontal |
text | 下拉文字 | 字符串 多个下拉选项用竖线分隔,例如:选项1|选型2 |
textColor | 文字颜色 | 16进制,例如#FFFFFF |
textSize | 文字大小 | 具体数字+dp |