Android button靠右侧显示
注:要在包含button的父布局中设置
android:layout_height="wrap_content"
android:orientation="horizontal" >
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="10dp" >
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="right" //gravity是指里面的内容靠右显示,内容指的是里面的两个button
android:layout_marginRight="10dp">
android:layout_height="wrap_content"
android:text="删除"
android:id="@+id/bt_delete_notepad"
/>
android:layout_height="wrap_content"
android:text="替换"
android:id="@+id/bt_update_notepad"
/>
关于gravity和layout_gravity的区别详情请看博客:http://blog.csdn.net/zhangjikuan/article/details/25736727
更多相关文章
- ktolin在Android中布局界面拼接
- android之布局LinearLayout
- android之线性布局LinearLayout以及weight权重使用
- 【Android】使用代码动态创建布局
- Android Studio 自带的侧滑布局设置
- Android应用.国际化-屏幕适配-样式与主题
- Android各种屏幕尺寸