机器人,滚动型稍内侧截止TextView中的最后一行 [英] android, last line of textview inside of scrollview slightly cutoff

查看:95
本文介绍了机器人,滚动型稍内侧截止TextView中的最后一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TextView的最后一行得到略微截断。字母较大和下方被切断(G,J,Y ...)。我发现或者尝试解决没有工作过,如添加填充,保证金,去除layout_gravity ...
这当改变文本,并设置若干行,而不是与默认的字符串发生。

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.

在code以下是里面的FrameLayout

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" />

推荐答案

有关你的的TextView 这里面滚动型添加的android:paddingBottom会=10dip
这将很好地工作。你给的填充任意值。

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

这篇关于机器人,滚动型稍内侧截止TextView中的最后一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆