【发布时间】:2012-12-12 07:14:47
【问题描述】:
我有两个带有两种颜色的文本视图
- “qwer tyu iopasd fgh jkl zxcv bnm”和
- “123456789”
我想设计文本视图,例如在“qwer tyu iopasd fgh jkl zxcv bnm”旁边显示没有任何空格“123456789” 如果第一个 textview 到大约 2 到 3 行,那该怎么办?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="qwer tyu iopasd fgh jkl zxcv bnm"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123456789"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
【问题讨论】:
-
将
android:layout_marginLeft="5dip"用于textView2 -
@kumaand 如果第一个文本太大并且填充到 1 行半,那么它不起作用
标签: android textview ui-design