Possible Duplicate:
android - line break in TextView
<TextView
android:text="Weeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee."
android:id="@+id/txtDesc"
android:maxLines="3"
android:lines="3"
android:ellipsize="end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
我这样试过,但最后只显示 1 行 ...
如何将它设置为显示 2 行...
如果我使用 android:ellipsize="marquee"instread 它不会显示 ... 最后只显示 1 行
您可以使用两个 TextView
。在一个 TextView
中显示部分文本,在第二个 TextView
中使用以下代码。
我认为椭圆会在一行中显示数据,然后省略。如果你使用椭圆我不认为你可以在 TextView
中获得两行数据。这就是为什么我建议您使用两个 TextView
。在最后一个 TextView
使用椭圆
<TextView
android:text="Weeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee are one of the UK�s leading retailers, with over 21 million people visiting our stores each week. We offer stylish, high quality, great value clothing and home products, as well as outstanding quality foods, responsibly sourced from around 2,000 suppliers globally. We employ over 75,000 people in the UK and abroad, and have over 600 UK stores, plus an expanding international business. We are the number one provider of womenswear and lingerie in the UK, and are rapidly growing our market share in menswear, kidswear and home, due in part to our growing online business. Overall, our clothing and homeware sales account for 49% of our business. The other 51% of our business is in food, where we sell everything from fresh produce and groceries, to partly-prepared meals and ready meals. Now more than ever, we�re also known for our green credentials as a result of our five-year eco plan, Plan A, which will see us, amongst other things, become carbon neutral and send no waste to landfill by 2012."
android:id="@+id/txtDesc"
android:maxLines="3"
android:lines="3"
android:ellipsize="end"
android:layout_width="100dip"
android:layout_height="wrap_content"/>
谢谢
迪帕克