我試圖升級我的PopupMenu,所以它會帶有圖標和自定義樣式。
我已經創建了一個新的佈局也自定義PopupMenu(佈局)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:id="@+id/layout_sharea"
android:background="@drawable/share"
android:paddingLeft="10.0dip"
android:paddingRight="10.0dip"
android:layout_width="wrap_content"
android:layout_height="50.0dip"
android:onClick="share">
<TextView
android:id="@+id/sharetexta"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/share"
android:drawableLeft="@drawable/share_button"
android:drawablePadding="10.0dip"
android:layout_centerVertical="true" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_shareb"
android:background="@drawable/share"
android:paddingLeft="10.0dip"
android:paddingRight="10.0dip"
android:layout_width="wrap_content"
android:layout_height="50.0dip"
android:layout_below="@+id/layout_sharea"
android:onClick="share">
<TextView
android:id="@+id/sharetextb"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/share"
android:drawableLeft="@drawable/share_button"
android:drawablePadding="10.0dip"
android:layout_centerVertical="true" />
</RelativeLayout>
</RelativeLayout>
我想要的彈出菜單在這個畫面進行定製(是這個佈局)像
引用了一個簡單的自定義文字顏色/背景修復這個【答案】(https://stackoverflow.com/a/40017199/4625829)。 – 2017-12-01 08:07:23