【发布时间】:2012-12-03 01:35:50
【问题描述】:
我有一个 TextView,它的文本太大而无法在一行中显示,因此它将我的全文显示在不同的行中。但是,TextView 的宽度现在占据了全屏,即使文本本身没有。
例如,假设我的文本是“一些长文本”。 Get的显示如下:
有些长
文字
我已经使用 wrap_content 定义了 TextView。
<TextView
android:id="@+id/txtMainText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Some long text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000000" />
我希望 TextView 的宽度是“Some long”的宽度,而不是更宽。我该怎么做?
谢谢
【问题讨论】:
标签: java android android-layout