2017-11-08 2 views
-2

캔트 텍스트 뷰

하이에 대해 이미지 센터 정렬 제가 텍스트 뷰 평행에 따른 이미지보기 중심을 맞추려 개의 텍스트 뷰와 상대 레이아웃 안에 하나 개의 이미지보기 을 가지고 있지만 이제 텍스트보기에 평행하게 아래로 정렬 imagview, PLS, 나랑 내 다음 코드를 사용하여 코드를 바꿉니다 1 번째 이미지를 결과를 원하지만, 이제 두 번째 이미지

<LinearLayout 

android:layout_height="wrap_content" 
android:layout_marginLeft="10dp" 
android:layout_marginRight="10dp" 
android:layout_weight="1" 
android:layout_width="0dp" 
android:orientation="vertical"> 

<RelativeLayout 
    android:layout_height="wrap_content" 
    android:layout_marginTop="10dp" 
    android:layout_width="match_parent"> 

    <TextView 
     android:id="@+id/totPendingTxt" 
     android:layout_alignParentLeft="true" 
     android:layout_height="wrap_content" 
     android:layout_marginRight="5dp" 
     android:layout_width="wrap_content" 
     android:text="TOTAL" 
     android:textAllCaps="true" 
     android:textColor="@color/Color" 
     android:textSize="@dimen/text_size_small" /> 

    <ImageView 
     android:contentDescription="@string/icon" 
     android:id="@+id/imgPendingOrder" 
     android:layout_gravity="center_vertical" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="10dp" 
     android:layout_toRightOf="@+id/totPendingTxt" 
     android:layout_width="wrap_content" 
     android:src="@drawable/icon_arrow" /> 

    <TextView 
     android:id="@+id/totalPendingOrders" 
     android:layout_alignParentRight="true" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="5dp" 
     android:layout_width="wrap_content" 
     android:text="" 
     android:textAllCaps="true" 
     android:textColor="@color/Color" 
     android:textSize="@dimen/text_size_small" /> 


</RelativeLayout> 

</LinearLayout> 

답변

0

처럼 무엇입니까 도움이 당신을 도울 것입니다 ㄴ 수 있습니다 :)

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp" 
    android:layout_weight="1" 
    android:orientation="vertical"> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="10dp"> 


       <TextView 
        android:id="@+id/totPendingTxt" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_alignParentRight="true" 
        android:layout_marginRight="5dp" 
        android:text="TOTAL" 
        android:textAllCaps="true" 
        android:textColor="@color/Color" 
       android:textSize="@dimen/text_size_small" /> 

       <ImageView 
        android:id="@+id/imgPendingOrder" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerInParent="true" 
        android:src="@drawable/icon_arrow" /> 

       <TextView 
        android:id="@+id/totalPendingOrders" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_alignParentLeft="true" 
        android:text="" 
        android:textAllCaps="true" /> 

      </RelativeLayout> 

</LinearLayout>