我想在Android的创造是这样的:如何使用%?在LinearLayout上放置ImageView?
我目前的做法是设法创建一个LinearLayout中,并用不同的权重的一些看法吧。这工作得很好:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/market_bar"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:background="@android:color/holo_red_light"/>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:background="@android:color/holo_green_dark"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
但现在如何添加图像中出现的标记?我不认为我可以用重量来实现这一点。例如,如何将标记放置在条的最后?
谢谢
使用farmelayout你的基地布局。 – 2014-11-03 23:31:02