2016-07-11 2 views
0

나는 안드로이드 스튜디오와 GUI 디자이너위젯 역 - 나는 응용 프로그램을 실행할 때 안드로이드 스튜디오

을 사용 나는 왼쪽에있는 텍스트 뷰를 볼 수 있지만 내가

을 이미지 뷰

과 같은 권리 GUI 디자이너에 넣어 In GUI Designer

In mobile (I've tried 2 devices with diff System Versions)

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="horizontal" android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:weightSum="1"> 
<ImageView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/imageView" 
    android:src="@drawable/celebi" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:contentDescription="@string/celebi_picture" /> 
<TextView 
    android:id="@+id/txt_detail" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:textSize="18sp" 
    android:textStyle="bold" 
    android:textColor="#000000" 
    android:layout_marginRight="10dp" 
    android:layout_marginLeft="10dp" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentEnd="true" 
    android:layout_toEndOf="@+id/imageView" 
    android:layout_alignBottom="@+id/imageView" 
    android:layout_toRightOf="@+id/imageView" /> 

,536,913,632 10

이 GridLayout 또한 역의 것들!

<GridLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<TextView 
    android:layout_width="150dp" 
    android:layout_height="150dp" 
    android:id="@+id/txt_detail" 
    android:layout_row="0" 
    android:layout_column="1" /> 

<ImageView 
    android:layout_width="150dp" 
    android:layout_height="150dp" 
    android:id="@+id/imageView" 
    android:layout_row="0" 
    android:layout_column="2" 
    android:src="@mipmap/ic_launcher" /> 

이있는 LinearLayout 같은 일 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<TextView 
    android:layout_width="150dp" 
    android:layout_height="150dp" 
    android:id="@+id/txt_detail" 
    android:layout_row="0" 
    android:layout_column="1" /> 

<ImageView 
    android:layout_width="150dp" 
    android:layout_height="150dp" 
    android:id="@+id/imageView" 
    android:layout_row="0" 
    android:layout_column="2" 
    android:src="@mipmap/ic_launcher" /> 

답변

1

당신은 layout_alignParentRightlayout_alignParentEnd을 사용하고 있습니다. 이전 버전은 RTL 언어를 지원하지 않으므로 여러 버전의 Android에서 다를 수 있습니다. 또한 장치에 설정된 언어가 RTL인지 아닌지에 따라 변경됩니다.

- = 편집 = -

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:id="@+id/imageView" 
     android:src="@drawable/celebi" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentLeft="true" 
     android:contentDescription="@string/celebi_picture" /> 

    <TextView 
     android:id="@+id/txt_detail" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:textSize="18sp" 
     android:textStyle="bold" 
     android:textColor="#000000" 
     android:layout_marginRight="10dp" 
     android:layout_marginLeft="10dp" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentRight="true" 
     android:layout_toRightOf="@+id/imageView" /> 
</RelativeLayout> 
+0

내가 시도이 : <이미지 뷰 안드로이드 : layout_width = "144dp" 안드로이드 : layout_height = "144dp" 안드로이드 : ID = "@ + ID/이미지 뷰" 안드로이드 : SRC = "@ 드로어 블/mew "/> 같은 문제! LinearLayout과 이것으로 문제가 발생하면 어떻게해야합니까? –

+0

저는 제 대답에 XML을 넣을 것입니다. 그것을 시도하고 그것이 작동하는지보십시오. – CaseyB

0

는 AndroidManifest.xml에

이 코드를 이것은 나를 위해 작동
<application 
    android:supportsRtl="true"/> 

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<ImageView 
    android:id="@+id/imageView" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_alignParentTop="true" 
    android:contentDescription="@string/app_name" 
    android:src="@mipmap/ic_launcher" /> 

<TextView 
    android:id="@+id/txt_detail" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_alignParentEnd="true" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentTop="true" 
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp" 
    android:layout_toEndOf="@+id/imageView" 
    android:layout_toRightOf="@+id/imageView" 
    android:text="asfsksdgk" 
    android:textColor="#000000" 
    android:textSize="18sp" 
    android:textStyle="bold" /> 

+0

여전히 같은 문제 –

0

쓰기이 줄을 교체합니다. 선형 레이아웃에서

관련 문제