0

저는 전체 사진과 함께 표시되는 모든 항목을 포함하는 목록보기가있는 선형 레이아웃으로 설계했으며 멋진 코멘트의 일부만 남겨 둡니다. 사진 만 나오면 작은 사진으로 표시됩니다. 부분은 나오는 그러나 다른 큰 사진에서 그것은하지 않습니다버그 레이아웃에 일부가 표시되지 않습니다.

피카소를 구현하는 것이 좋을 것이다 그러나 나는 그것을 할 방법을 알고하지 않거나 그것이 내가 레이아웃을

the part where not everything is show

을 첨부 할 수없는 경우 : 이것은 리사이클 러 뷰의 layout_post 부분입니다

,515,
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:orientation="vertical"> 

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


    <TextView 
     android:layout_marginBottom="5dp" 
     android:id="@+id/tv_post_username" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="16dp" 
     android:layout_marginRight="8dp" 
     android:layout_marginTop="16dp" 
     android:layout_weight="1" 
     android:singleLine="true" 
     android:text="Username" 
     android:textColor="@android:color/black" 
     android:textSize="16sp" 
     android:textStyle="bold" /> 

    <TextView 
     android:id="@+id/tv_time" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginRight="16dp" 
     android:layout_marginTop="16dp" 
     android:text="10h30" /> 
</LinearLayout> 

<TextView 
    android:id="@+id/tv_post_text" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="8dp" 
    android:layout_marginLeft="16dp" 
    android:layout_marginRight="16dp" 
    android:text="Post text has some words that I could use for a placeholder like this" /> 

<ImageView 
    android:id="@+id/iv_post_display" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:adjustViewBounds="true" 
    android:src="@drawable/imageholder" /> 

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



    <LinearLayout 
     android:id="@+id/like_layout" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:gravity="center_vertical" 
     android:orientation="horizontal" 
     android:padding="16dp"> 

     <ImageView 
      android:id="@+id/iv_like" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/chill" 
      android:layout_marginBottom="1dp"/> 

     <TextView 
      android:id="@+id/tv_likes" 
      android:layout_marginTop="2dp" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="8dp" 
      android:text="0" 
      android:textSize="16sp" /> 
    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/comment_layout" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="16dp" 
     android:gravity="center_vertical" 
     android:orientation="horizontal" 
     android:padding="16dp"> 

     <ImageView 
      android:layout_width="wrap_content" 
      android:layout_marginTop="5dp" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_mode_comment_black_24dp" /> 

     <TextView 
      android:layout_marginTop="5dp" 
      android:id="@+id/tv_comments" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="8dp" 
      android:text="0" 
      android:textSize="16sp" /> 
    </LinearLayout> 
</LinearLayout> 

이것은 rowpost 포함되어있는 cardview 인 layoutpost

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

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="12dp" 
    android:layout_marginRight="12dp" 
    android:layout_marginTop="20dp" 
    android:layout_marginBottom="60dp" 
    android:elevation="10dp"> 

    <include layout="@layout/layout_post" /> 
</android.support.v7.widget.CardView> 

콘텐츠보기 :

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_marginTop="95dp" 
app:layout_behavior="@string/appbar_scrolling_view_behavior" 
tools:context="com.android.octa.memetixs.Activities.main.PostActivity" 
tools:showIn="@layout/app_bar_post"> 

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="471dp"> 

    <android.support.v4.view.ViewPager 
     android:id="@+id/myViewPager" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 


    </android.support.v4.view.ViewPager> 

</RelativeLayout> 

,

가 보인다면이 작고 해상도가 낮은 사진을 여기에 있습니다 :

second photo

을 그리고 여기 당신이 weightSum하지 않고있는 LinearLayout이 간단한 다음 속성을 사용하는 경우가

+0

'레이아웃이 일부 부분을 표시하지 않습니다. ' – rafsanahmad007

+0

like 및 comment 버튼이 포함 된 선형 레이아웃의 부분 좋은 품질의 사진을 업로드 할 때 사진의 위 부분과 같이 해당 부분이 사라집니다. @ rafsanahmad007 – Dskato

답변

0

을해야으로 모든 것이 표시되어있는 경우 자식 뷰를 다른 뷰에 쌓아 넣는다.

LinearLayout에서 안드로이드 : weightSum 속성을 사용하고 자식보기에 android : layout_weight + android : layout_height = "0dp"를 사용하고 예를 들어 weightSum == 6이고 자식이 layout_weight == 1이면 1/6 공간.

+0

어느 부분에서 해당 속성을 사용해야합니까 @ Tonteria24 – Dskato

+0

layour xml –

관련 문제