2013-12-16 2 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

android : layout_weight = "1.0"을 루트 LinearLayout에 추가하는 것이 좋지 않습니까? – 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

당신은 또한 텍스트 뷰에서 drawableRight 속성을 시도 할 수 있습니다 ..

관련 문제