首页 > 移动平台 > 详细

Android 布局中 ScrollView 内的 TextView 最后一行被遮住的解决办法

时间:2019-06-30 10:30:01      阅读:205      评论:0      收藏:0      [点我收藏+]

很简单,不要在 ScrollView 内部直接使用 TextView,而是在中间加一层 LinearLayout,就可以完美解决。

   <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="15dp"
        android:layout_weight="1"
        android:background="@drawable/password_input_text_bg"
        app:layout_constraintBottom_toTopOf="@id/bottom"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_weight="1">

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

            <TextView
                android:id="@+id/console"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="15dp"
                app:layout_constraintBottom_toTopOf="@id/bottom" />
        </LinearLayout>

    </ScrollView>

 

Android 布局中 ScrollView 内的 TextView 最后一行被遮住的解决办法

原文:https://www.cnblogs.com/memoryLost/p/11108756.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!