我正在使用RelativeLayout在我們的xml中顯示帶有TextView(count)的carticon。TextView隱藏在按鈕後面
代碼:
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:minHeight="?attr/actionBarSize"
android:background="@color/primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="65dip"
android:layout_height="65dip"
android:id="@+id/showevents"
android:layout_gravity="right"
android:textSize="12sp"
android:background="@drawable/cart"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_margin="0dp"
android:textColor="#000000"/>
<TextView
android:id="@+id/textOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/showevents"
android:layout_alignRight="@id/showevents"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:paddingBottom="1dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:text=""
android:textColor="#FFF"
android:textSize="16sp"
android:textStyle="bold"
android:background="@drawable/badge_circle"/>
</RelativeLayout>
我怎麼能顯示的TextView(在右側)就在按鈕上方? 現在我們的TextView顯示在購物車圖標後面。
任何幫助,將不勝感激
包括截圖和你嘗試過什麼到目前爲止,將有助於解釋。 – Shlublu