我遇到了 TextView 与 ScrollView 不匹配的问题...
这是我的代码:
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scrollViewSlide"
tools:ignore="UselessParent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_gravity="center_vertical|center_horizontal"
android:id="@+id/txtPassage"
android:textAlignment="center"
android:textIsSelectable="true"
android:textColor="#ffffff"
android:textSize="15sp"
tools:ignore="UnusedAttribute" />
</LinearLayout>
</ScrollView>
最佳答案
试试这个
<ScrollView
android:layout_width="match_parent"
android:fillViewport="true"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/li1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:text="Hellofgbjfdkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkhbhbghbuuuuuuuuuuuuuuuubfiiiiiiiiiibigyygfjjjjjjjjjjjjjjjjjjjjjjjjjj\nfjgggggggggggggggg\ngfggggggggggggggggggg\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\njgjijhijghijgfhjgfhjigfjhijgfhjgi
jfdjgkfjd\nkkgkfgklfkgfg"
android:layout_height="match_parent" />
</LinearLayout>
</ScrollView>
关于android - TextView 不适合 ScrollView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44880084/