三非_程序猿 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 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题