小编umn*_*4ek的帖子

如何确定TextView中可见的行数?

如何在可见部分显示多少行TextView?我使用的文字并没有完全放在TextView每个屏幕分辨率上.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
    android:id="@+id/logs_text"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

</LinearLayout>

String s = "very big text"
TextView logText = (TextView) view.findViewById(R.id.logs_text);
logText.setText(s);     
Run Code Online (Sandbox Code Playgroud)

android lines textview

18
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

lines ×1

textview ×1