How to alignment the center position of the button in Android?
来源:互联网 发布:java项目视频 编辑:程序博客网 时间:2024/06/05 18:21
How to alignment the center position of the button in Android?
In the XML layout, can able to set the center postion by using the "android:layout_gravity", the sample XML code as below,
<button android:text="ClickMe"
android:id="@+id/btClick"
android:layout_width="100px"
android:gravity="center_vertical|center_horizontal"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal|center" >
</button>
Attribute usage,
- android:gravity > align the text
- android:layout_gravity > align the layout position of the element
- android:layout_width > width of the button
- android:layout_height > hight of the button ( wrag_content sense autoresize by using text )
- How to alignment the center position of the button in Android?
- How to set the title of UIButton as left alignment?
- print 'welcome to masm!' in the center of the screen.
- how to translate the text of push button
- How to build the environment of MSYS in the windows?
- How to hide the OK button in the dialog in .Net Compact Framework application?
- From obscurity to the center of stage
- Alignment of the Planets
- Alignment of the Planets
- How to implement the built in effects of DirectX.DirectSound
- How to use Events in the Context of C#
- How to build the environment of XPCOM in Windows XP
- How to use "man" effectively in the development of Linux
- How to use the pointer of function in a class?
- How to change the font size in legend of matlab
- How to update the version of pgfplots in MiKTeX
- how to calculate the textsize of TLatex in CernRoot
- How to Control the [Add document] button on the bottom of every view?
- CopyDirectoryTree
- 函数模板与类模板的区别
- WebView 关于如何隐藏地址栏,用WebView 来显示网页内容
- 总线频率
- 新人报道
- How to alignment the center position of the button in Android?
- 驱动程序开机自动加载
- 利用rdp进行远程桌面连接
- 关于Public,Private,Protected,Published
- Android marketplace - public key
- Android Animation Framework
- 大三开始
- 问题解决:The project cannot be built until build path errors are resolved
- android获取屏幕高度和宽度 的方法