我試圖在徽章末尾的textview
中添加徽章,但是當我在我的設備上運行樣本時,bagde被包裝爲textview
大小。我想要它的右下方的textview
長度。徽章圖標定位在TextView長度的右下方Android
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app1="http://schemas.android.com/apk/res/socialbible.reef"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white"
android:clickable="false"
android:focusable="false"
android:paddingLeft="@dimen/ten_dp" >
<TextView
android:id="@+id/txNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginRight="@dimen/one_dp"
android:clickable="false"
android:focusable="false"
android:text="60"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/myButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="false"
android:layout_toRightOf="@+id/txNumber"
android:background="@color/transparent"
android:clickable="false"
android:focusable="false"
android:gravity="top"
android:paddingBottom="@dimen/six_dp"
android:text="1111111111111111" />
<TextView
android:id="@+id/txCommentaires"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/myButton"
android:layout_alignParentBottom="false"
android:layout_alignRight="@+id/myButton"
android:layout_marginLeft="@dimen/ten_dp"
android:background="@drawable/badge_circle"
android:clickable="false"
android:focusable="false"
android:paddingLeft="@dimen/six_dp"
android:paddingRight="@dimen/six_dp"
android:text="10"
android:textColor="#FFF"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
爲兩個或多行txCommentaires變得不可見。 – Dimitri
你可以發佈你所得到的圖像 – Manishika
好的檢查我的問題。 – Dimitri