zoukankan      html  css  js  c++  java
  • 解决LinearLayout中控件不能居右对齐

    LinearLayout布局时使用右对齐android:layout_gravity="right")控件对齐方式不生效,需要设置 android:layout_weight="1" 才能右对齐控件,原因在于后者把位置平分了。

     

    <</span>LinearLayout android:gravity="right" android:layout_margin="2dip"

           android:orientation="horizontal" android:layout_gravity="center_vertical"

           android:layout_width="wrap_content" android:layout_height="wrap_content"

           android:layout_weight="1" >

     

           <</span>Button android:id="@+id/btnCommonExpress" android:width="50dip"

               android:layout_width="wrap_content" android:layout_height="wrap_content"

               android:layout_alignParentRight="true" android:text="常用" />

           <</span>Button android:id="@+id/btnAll" android:width="50dip"

               android:layout_width="wrap_content" android:layout_height="wrap_content"

               android:layout_alignParentRight="true"android:layout_alignRight="@+id/btnCommon"

               android:text="所有" />

     </</span>LinearLayout>

  • 相关阅读:
    mysql的常用函数
    oracle的常用函数
    oracle 11g安装(转)
    Oracle TNS配置浅析
    PL/SQL Developer连接本地Oracle 11g 64位数据库
    mysql之对视图的操作
    mysql之对索引的操作
    mysql之对表的操作
    Mac机装Win7后 启动只见鼠标怎么办
    天高云淡风轻
  • 原文地址:https://www.cnblogs.com/wxmdevelop/p/6972459.html
Copyright © 2011-2022 走看看