嘿,我越來越想從我的視圖中打開一個彈出菜單時出現以下錯誤:的PopupMenu從supportlibrary
10-15 11:43:27.421: E/AndroidRuntime(7825): java.lang.RuntimeException: Binary XML file line #17: You must supply a layout_height attribute.
我的代碼是在這裏:
OnClickListener thirdButtonListener = new OnClickListener() {
@Override
public void onClick(View v) {
PopupMenu popup = new PopupMenu(activity,v);
popup.getMenu().add(Menu.NONE, BottomBarView.ORDER_OVERVIEW, 1, R.string.app_order_overview);
popup.getMenu().add(Menu.NONE, BottomBarView.SUPPLIERS, 2, R.string.app_suppliers);
popup.getMenu().add(Menu.NONE, BottomBarView.INVOICES, 3, R.string.app_invoice);
popup.show();
}
};
這似乎有些ATTR支持庫中未設置的值...
像這樣:android:layout_height="?attr/dropdownListPreferredItemHeight"
但不確定。 有什麼建議嗎?
您可以在http://stackoverflow.com/questions/17975002/android-v7-support-library-popup-menu/18154001#18154001?newreg=f836bf03893a4b429976701aef77c63d – user3125204