Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android, last line of textview inside of scrollview slightly cutoff

The last line of the textview gets slightly cutoff. Letters that are larger and below are cut off (g,j,y...). None of the solutions I have found or tried worked, like adding padding, margin, removing layout_gravity... That happens when changing text, and setting several lines, not with default string.

The code below is inside a FrameLayout.

<RelativeLayout
android:id="@+id/window"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/black">

<RelativeLayout
    android:id="@+id/action_bar"
    android:layout_alignParentTop="true"
    android:layout_width="fill_parent"
    android:layout_height="46dp"
    android:background="@color/royal_blue" >

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="38dp"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:layout_gravity="center_vertical|left"
        android:layout_margin="4dp"
        android:background="@drawable/ic_launcher" />

    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:id="@+id/space"
    android:background="@color/royal_blue"
    android:layout_toLeftOf="@+id/selectLeft"
    android:layout_toRightOf="@+id/imageView" />

    <Button
        android:id="@+id/buttonOptions"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="33dp"
        android:layout_height="33dp"
        android:layout_marginLeft="4dp"
        android:layout_marginRight="4dp"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_gravity="center_vertical|center_horizontal"
        android:background="@drawable/ic_action_overflow"
        android:gravity="right" />


        <TextView
            android:id="@+id/selectLeft"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_toLeftOf="@+id/selectRight"
            android:layout_marginRight="4dp"



            android:gravity="center"
            android:textColor="@color/white"
            android:textSize="20sp" />
        <TextView
            android:id="@+id/selectRight"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_toLeftOf="@+id/buttonOptions"
            android:layout_marginRight="2dp"
            android:layout_marginLeft="4dp"

            android:gravity="center"
            android:textColor="@color/white"
            android:textSize="20sp" />


</RelativeLayout>

<View
    android:id="@+id/action_bar_shadow"                
    android:layout_width="fill_parent"
    android:layout_height="2dp"
    android:layout_below="@+id/action_bar"
    android:background="@color/darker_blue" />

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginLeft="4dp"
    android:layout_marginRight="4dp"
    android:layout_marginBottom="4dp"
    android:layout_below="@+id/action_bar_shadow"                
    android:background="@color/black"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="48dp" >

        <EditText
            android:id="@+id/editText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_gravity="center_horizontal"
            android:layout_marginBottom="4dp"
            android:layout_marginTop="4dp" />
    </RelativeLayout>

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="8dp">

        <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginTop="4dp"
        android:layout_marginBottom="10dp"
        android:text="@string/IntroduceWord"
        android:layout_marginLeft="4dp"
        android:textColor="@color/white"
        android:textSize="17sp" />
    </ScrollView>

</LinearLayout>

<ImageView
    android:id="@+id/resize"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:contentDescription="Resize"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:adjustViewBounds="true"
    android:paddingRight="-8dp"
    android:paddingBottom="-0dp"
    android:layout_marginBottom="-8dp"
    android:layout_marginRight="-1dp"
    android:src="@drawable/corner_blue" />
<View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:layout_margin="0dp"
    android:layout_alignParentBottom="true"
    android:background="@color/royal_blue" />

like image 634
lotdrops Avatar asked Jan 29 '14 11:01

lotdrops


1 Answers

For your TextView which is inside ScrollView , add android:paddingBottom="10dip" It will work perfectly. You give any value for padding.

like image 186
Manjunath Avatar answered Oct 05 '22 22:10

Manjunath