我有一个textview,当它有两行以上的文本时,第二行变成第一行,下面有一行可用,第一行不应该是可见的。这是可能的android的textview?Textview with lines scroll
1
A
回答
1
试试这个
<TextView
android:id="@+id/TextView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="false"
android:maxLines="3"
android:scrollbars="vertical"
android:textColor="@android:color/secondary_text_dark_nodisable"
>
代码
TextView textView = (TextView)findViewById(R.id.TextView01);
textView.setMovementMethod(ScrollingMovementMethod.getInstance());
0
是可能的。创建高度为2 * text_line_height的scrollView。并在里面添加TextView。其中text_light _height与textSize成比例。所以只需尝试一些组合,比如14sp vs 8o dp。 好处是sp/dp会为所有设备大小提供相同的行为。
0
是的,看看。
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="30dp" >
<TextView
android:id="@+id/TextView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="false"
android:textSize="20dp"
android:text="kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"
/>
</ScrollView>
相关问题
- 1. Android TextView Lines Collection
- 2. git diff with interleaved lines
- 3. Stepline Chart with D3.js with individual lines
- 4. Android listview with empty lines when empty
- 5. Gnuplot:spiro with cairolatex without grid lines
- 6. Div Scroll with android 2.3.3
- 7. jquery smartAutocomplete with infinite scroll
- 8. React Native:ScrollView with auto scroll
- 9. Highcharts Zooming with Scroll Bar
- 10. React dnd with auto Scroll
- 11. fullpage mousewheel scroll with easeInCirc效果
- 12. jQuery onepage-scroll with a scrollable div
- 13. linux zoneminder video with striped black and white lines
- 14. Canvas drawline with semi transparent lines overlapping problem
- 15. Impementing Vertical Scroll with horizontal swipe in Android
- 16. TextView with onTouchEvent
- 17. listview with 4 textview
- 18. Python Tkinter Text Widget with Auto&Custom Scroll
- 19. TextView with AndroidProguardScala的Settext
- 20. CALayer with Scroll View上的动画
- 21. 覆盖浏览器CTRL +(WHEEL)SCROLL with javascript
- 22. TextView with Html + <img base64/>
- 23. ANDROID:SQLite - ListView 2 Lines
- 24. ListView Data Scroll Android
- 25. grep on color lines
- 26. Countour lines Matplotlib Python
- 27. word interop solid lines
- 28. Java Lines Confusion
- 29. Bresenham Lines Drawing Alogrithm
- 30. Opencv HoughLines Lines Theta?