我的主线性布局中有一个 ScrollView ,如下所示:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="8dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scrollbars="none">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">
---content---
</LinearLayout>
</ScrollVIew>
</LinearLayout>
当我滚动 TextView 时,“全名”被剪切并且无法正确显示。
我已经搜索了所有解决方案,并尝试了以下两种方法:
android:fillViewport="true"
android:clipToPadding="false"
但是没有成功。有什么解决办法吗?
最佳答案
现在我从Google Plus上的android开发者官方页面找到了答案:
我需要设置 android:scrollbarStyle="outsideOverlay"
以及 android:clipToPadding="false"
。
这正是与我的问题相符的:https://plus.google.com/+AndroidDevelopers/posts/LpAA7q4jw9M
关于java - ScrollView 被切入主布局内,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29458712/