這是一個textview可能有長文本的一面。它流過並將屏幕上的一半額定值欄推下。我有一個textview溢出,無論我給它什麼參數
我該如何削減文本並且不推送評分欄?
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="2" >
<TextView
android:id="@+id/rest_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:paddingLeft="3dp"
android:singleLine="true"
android:text="long text goes goes here long text goes goes here long text goes goes here"
android:textAppearance="?android:attr/textAppearanceLarge" />
<RatingBar
android:id="@+id/myRatingBar"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:numStars="5" />
</LinearLayout>
此屬性只在'RelativeLayout' – nicopico 2013-03-16 16:34:47
theyre裏面沒有相對佈局 – code511788465541441 2013-03-16 16:34:52
我編輯了我的答案,您可以限制文本視圖的長度 – 2013-03-16 16:36:17