2013-12-16 85 views

回答

5
<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> 
+0

工程,在一分钟内接受。精确到9分钟。 – user2883477

+0

在根LinearLayout中添加android:layout_weight =“1.0”不是更好吗? – azerto00

0

您可以设置水平方向线性布局和权重都的观点。

0

只是一个水平方向添加其他的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> 
+0

这没有奏效,我试过了。 – user2883477

+0

您需要在TextView和ImageView中添加一些属性。 –

+0

我当然了。我错过了android:layout_weight部分。查看答案Gooziec。 – user2883477

0
<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> 
1

你可以尝试在TextView中还drawableRight属性..

相关问题