2017-12-07 2 views
-1

하나의 줄이 TextView 및 2 ImageViews 레이아웃을 만들어야합니다. 그들은 다음과 같은 순서로되어 있어야합니다 : TextView | ImageView1 | [남은 공간] | 제약과 ImageView2XML 레이아웃을 textview 및 2 imageviews

모든이가 텍스트 뷰의 텍스트 오버 플로우의 경우에는 1 차 이미지 뷰는 밀리와 제 2 하나는 넘치는 텍스트 스틱 손질하고 줄임표로 나타 가져옵니다. 다음과 같은 것 : 트리밍 된 TextView ... | ImageView1 |

enter image description here은 어떻게하고 설계하는이 특정 쓰임새에 대해 수행해야한다 : 인스턴스의보다 선명한 ImageView2

, 여기 그림입니까?

+0

내 대답을 확인하십시오. –

답변

1

이 시도 :

출력 1을 :

enter image description here

출력 2를 :

enter image description here

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/colorWhite" 
    android:orientation="vertical"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 

     <RelativeLayout 
      android:id="@+id/layout_message" 
      android:layout_width="0dp" 
      android:layout_weight="1" 
      android:layout_height="wrap_content"> 

      <TextView 
       android:id="@+id/tv_message" 
       style="@style/TextAppearance.AppCompat.Body1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingRight="30dp" 
       android:ellipsize="end" 
       android:lines="1" 
       android:text="Hello Mike bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla " /> 

      <ImageView 
       android:id="@+id/tv_msg_time" 
       android:layout_width="20dp" 
       android:layout_height="20dp" 
       android:src="@drawable/done_all" 
       android:layout_alignRight="@+id/tv_message" 
       android:textColor="@android:color/black" 
       android:textSize="10sp" /> 

     </RelativeLayout> 

     <LinearLayout 
      android:layout_width="0dp" 
      android:layout_height="wrap_content" 
      android:layout_weight="0.1" 
      android:gravity="end"> 

      <ImageView 
       android:layout_width="20dp" 
       android:layout_height="20dp" 
       android:src="@drawable/job_like" /> 

     </LinearLayout> 
    </LinearLayout> 
</LinearLayout> 
+0

안녕하세요. 답변을 작성하는 데 시간을내어 주셔서 감사합니다. 진드기와 심장 사이에 빈 공간이 나타납니다. 줄임표가 표시 될 때마다 진드기와 심장이 즉시 차례로 렌더링되기를 원할 것입니다. – Sagar

+1

나는 그것을 시도 할 것이다. –

+1

@Sagar 내 편집 된 답을 시도해보십시오. 다른 문제가 있으면 알려주세요. –

관련 문제