回答
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
>
<TextView
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="0.75" />
<ImageView
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="0.25"
/>
</LinearLayout>
工程,在一分钟内接受。精确到9分钟。 – user2883477
在根LinearLayout中添加android:layout_weight =“1.0”不是更好吗? – azerto00
您可以设置水平方向线性布局和权重都的观点。
只是一个水平方向添加其他的LinearLayout到您的垂直的LinearLayout:
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal">
<TextView
android:layout_height="0dp"
android:layout_width="wrap_content"
android:layout_weight="3" />
<ImageView
android:layout_height="0dp"
android:layout_width="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<!-- Others layout here -->
</LinearLayout>
这没有奏效,我试过了。 – user2883477
您需要在TextView和ImageView中添加一些属性。 –
我当然了。我错过了android:layout_weight部分。查看答案Gooziec。 – user2883477
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
>
<TextView
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="0.75"
android:textStyle="bold" />
<ImageView
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="0.25"
/>
</LinearLayout>
你可以尝试在TextView中还drawableRight
属性..
- 1. 调整两个TextView的在LinearLayout中旁边的一个ImageView的
- 2. 在ListView中显示TextView旁边的ImageView
- 3. 在textView旁边添加ImageView在同一行中
- 4. LinearLayout:左边的TextViews,右边的ImageView大
- 5. 漂浮一个ImageView旁边的多个TextView元素
- 6. LinearLayout的ImageView和TextView不等于宽度
- 7. 的ImageView中的LinearLayout
- 8. Android:TextView旁边的ImageView没有显示
- 9. 如何将TextView对齐屏幕中心,并将ImageView粘贴在屏幕旁边?
- 10. Android - ImageView边距不出现在LinearLayout
- 11. 如何在LinearLayout中将我的ImageView与我的TextView对齐?
- 12. 两个textview和一个imageview在linearlayout中的位置
- 13. android垂直textview与图像旁边
- 14. textview下面的textview linearlayout
- 15. Linearlayout中的中心textview
- 16. 在LinearLayout中旋转ImageView的
- 17. LinearLayout中的Android ImageView位置
- 18. 固定宽度TextView旁边的可变宽度TextView
- 19. GridView与LinearLayout中的TextView
- 20. LinearLayout中的TextView和ListView
- 21. Android - ImageView上的TextView,边界大小等于Imageview Size
- 22. 为什么我的TextView在LinearLayout中无边框显示?
- 23. 如何让我的RelativeLayout出现在我的LinearLayout旁边?
- 24. ImageView不显示在LinearLayout中
- 25. 在LinearLayout中添加ImageView
- 26. 如何在Swift中将标签与其旁边的ImageView对齐?
- 27. Android:ListView问题在TextView中更改文本旁边的图像
- 28. Android将图像视图旁边的textview集中到
- 29. 在LinearLayout中裁剪textView
- 30. textview未显示在linearLayout中
什么问题呢? – keshav