android:布局参数,控件属性及各种xml的作用
2014-10-27 01:05
429 查看
今天看别人项目的时候,突然发现自己的界面布局这块实在是弱得很,所以特意上网找了一些布局方面的文来看,下面为了便于以后翻阅,特意转载过来。
android:布局参数,控件属性及各种xml的作用
效果如下:
ProgressBar
style="?android:attr/progressBarStyleHorizontal"
style="?android:attr/progressBarStyleLarge"
style="?android:attr/progressBarStyleSmall"
style="?android:attr/progressBarStyleSmallTitle"
其它一些参数:
android:excludeFromRecents="true"为true表示长按home键将显示此应用
android:screenOrientation="portrait" 永远竖屏显示
android:screenOrientation="portrait" 永远横屏显示
android:configChanges="keyboardHidden|orientation"竖屏切换横屏时应用也能弹出界面
分隔符
横向:
纵向:
CheckBox
style="?android:attr/starStyle"
类似标题栏效果的TextView
style="?android:attr/listSeparatorTextViewStyle"
其它有用的样式
android:layout_height="?android:attr/listPreferredItemHeight"
android:paddingRight="?android:attr/scrollbarSize"
style="?android:attr/windowTitleBackgroundStyle"
style="?android:attr/windowTitleStyle"
android:layout_height="?android:attr/windowTitleSize"
android:background="?android:attr/windowBackground"
在drawable-mdpi文件夹下定义button_selector.xml
在Layout中的main.xml
EditText 和 TextView 参数
android:inputType
指定输入法的类型,int类型,可以用|选择多个。取值可以参考:android.text.InputType类。取值包括:text, textUri, phone,number,等。
android:imeOptions
指定输入法窗口中的回车键的功能,可选值为normal, actionNext,actionDone,actionSearch等。部分输入法对此的支持可能不够好。
android:imeOptions="actionNext"
android:nextFocusDown="@+id/minute"
上两条加一起才能跳转到minute。
转载自:http://www.360doc.com/content/12/0410/16/9085503_202516981.shtml
android:布局参数,控件属性及各种xml的作用
|
ProgressBar
style="?android:attr/progressBarStyleHorizontal"
style="?android:attr/progressBarStyleLarge"
style="?android:attr/progressBarStyleSmall"
style="?android:attr/progressBarStyleSmallTitle"
其它一些参数:
android:excludeFromRecents="true"为true表示长按home键将显示此应用
android:screenOrientation="portrait" 永远竖屏显示
android:screenOrientation="portrait" 永远横屏显示
android:configChanges="keyboardHidden|orientation"竖屏切换横屏时应用也能弹出界面
分隔符
横向:
<View android:layout_width="fill_parent" android:layout_height="1dip" android:background="?android:attr/listDivider" />
纵向:
<View android:layout_width="1dip" android:layout_height="fill_parent" android:background="?android:attr/listDivider" />
CheckBox
style="?android:attr/starStyle"
类似标题栏效果的TextView
style="?android:attr/listSeparatorTextViewStyle"
其它有用的样式
android:layout_height="?android:attr/listPreferredItemHeight"
android:paddingRight="?android:attr/scrollbarSize"
style="?android:attr/windowTitleBackgroundStyle"
style="?android:attr/windowTitleStyle"
android:layout_height="?android:attr/windowTitleSize"
android:background="?android:attr/windowBackground"
在drawable-mdpi文件夹下定义button_selector.xml
<span style="font-size:18px;"><?xml version="1.0" encoding="UTF-8"?> < selector xmlns:android="http://schemas.android.com/apk/res/android"> < !-- 指定按钮按下时的图片 --> <item android:state_pressed="true" android:drawable="@drawable/start_down" /> < !-- 指定按钮松开时的图片 --> <item android:state_pressed="false" android:drawable="@drawable/start" /> < /selector></span>
在Layout中的main.xml
<span style="font-size:18px;"><Button android:id="@+id/startButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/button_selector" /></span>
EditText 和 TextView 参数
android:inputType
指定输入法的类型,int类型,可以用|选择多个。取值可以参考:android.text.InputType类。取值包括:text, textUri, phone,number,等。
android:imeOptions
指定输入法窗口中的回车键的功能,可选值为normal, actionNext,actionDone,actionSearch等。部分输入法对此的支持可能不够好。
android:imeOptions="actionNext"
android:nextFocusDown="@+id/minute"
上两条加一起才能跳转到minute。
转载自:http://www.360doc.com/content/12/0410/16/9085503_202516981.shtml
相关文章推荐
- android:布局参数,控件属性及各种xml的作用
- android:布局参数,控件属性及各种xml的作用
- android:布局参数,控件属性及各种xml的作用
- android:布局参数,控件属性及各种xml的作用
- android:布局参数,控件属性及各种xml的作用
- android:布局参数,控件属性及各种xml的作用
- android:布局参数,控件属性及各种xml的作用
- android之布局xml各种控件属性详解
- Android XML布局控件属性汇总
- Android 各种布局 控件内部属性大全|我是记不住了搞下来看看
- android布局也好,框架也好总之xml中控件中的name属性对应类时,貌似必须跟类名完全相同?
- Android设置布局参数,addView添加布局时指定控件属性
- Android开发---xml布局文件中的常见属性总结
- android通过style.xml文件定义相同控件的通用属性
- android-xml布局属性 - 随心
- android自定义Button,通过在XML布局文件里直接使用自定义参数
- Android布局文件中控件的高度与宽度属性设置
- Android 常用布局Xml属性详解
- Android布局文件中的各种属性
- android xml界面布局常用属性概括