三非_程序猿 2017-01-03 06:56 采纳率: 33.3%
浏览 823
已采纳

layout_wight的显示比例是反的

这是我的布局
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/list_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
android:id="@+id/order_list_one"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_weight="1"/>

    <ListView
        android:id="@+id/order_list_two"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
       android:layout_weight="4" />

</LinearLayout>
<ImageView
    android:id="@+id/cart_img"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:layout_alignParentBottom="true"
    android:src="@drawable/cart" />
<TextView
    android:id="@+id/amount_txt"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_toRightOf="@+id/cart_img"
    android:layout_alignParentBottom="true"
    android:text="0"
    android:textColor="#ff0000"
    android:textSize="15dp" />

这是显示的图片说明

  • 写回答

5条回答 默认 最新

  • xzz_6767 2017-01-03 07:13
    关注

    设置android:layout_weight属性的控件的android:layout_width="wrap_content"改成android:layout_width="0dp"

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题