마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

유동적인 scrollview 문의

0 추천

scrollview 유동적으로 크기가 변경

만일 textview내용이 별로 없을때 하단부에 배경색상이 짤리는 현상이 발생합니다.

image.

 

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:scrollbars="none">

    <LinearLayout
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:background="#E7E7E7">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="25dp"
            android:textSize="20dp"
            android:layout_marginTop="5dp"
            android:text="" />

        <TextView
            android:id="@+id/name"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/round" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="25dp"
            android:textSize="20dp"
            android:layout_marginTop="5dp"
            android:text="" />

        <TextView
            android:id="@+id/my_int"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/round"/>


        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="25dp"
            android:textSize="20dp"
            android:layout_marginTop="5dp"
            android:text="" />

        <TextView
            android:id="@+id/my"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/round"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:paddingLeft="15dp"
            android:paddingRight="15dp"
            android:paddingTop="5dp"
            android:paddingBottom="5dp" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="25dp"
            android:textSize="20dp"
            android:layout_marginTop="5dp"
            android:text="" />

        <TextView
            android:id="@+id/control"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/round"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:paddingLeft="15dp"
            android:paddingRight="15dp"
            android:paddingTop="5dp"
            android:paddingBottom="5dp" />

    </LinearLayout>
</ScrollView>

 

쿠쿠부다스 (6,470 포인트) 님이 2017년 9월 26일 질문

2개의 답변

0 추천
질문이 뭔가요?

이미지가 짤린다면 최소size min-height를 지정하면 됩니다
익명사용자 님이 2017년 9월 26일 답변
0 추천
ScrollView 하단의 LinearLayout에 android:paddingBottom="10dp"을 넣어보세요.
Will Kim (43,170 포인트) 님이 2017년 9월 26일 답변
...