TextView 不适合 ScrollView
TextView is not fit in ScrollView
我有一个问题,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>
s.th 显示是假的(最好这样说,大约隐藏了 5 行第一行)
使用此代码会有帮助
<ScrollView
android:layout_width="match_parent"
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="Hello"
android:layout_height="match_parent" />
</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>
我有一个问题,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>
s.th 显示是假的(最好这样说,大约隐藏了 5 行第一行)
使用此代码会有帮助
<ScrollView
android:layout_width="match_parent"
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="Hello"
android:layout_height="match_parent" />
</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>