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>

  • 相关阅读:
    Zero Copy
    内核态(Kernel Mode)与用户态(User Mode)
    Netty端口被占用问题
    AsyncHttpClient的连接池使用逻辑
    HashMap 与 ConcurrentHashMap
    Java NIO Test Case
    Netty writeAndFlush() 流程与异步
    Java 文件路径相关
    代理的匿名程度
    Netty堆外内存泄露排查与总结
  • 原文地址:https://www.cnblogs.com/wxmdevelop/p/6972459.html
Copyright © 2011-2022 走看看