这个是popupwindow的内容xml(就是放了个ListView):
展现popupwindow的时候,
public MenuPopup(final Context context) {
**super(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);**
View contentView = LayoutInflater.from(context).inflate(resId, null);
ListView lv = (ListView) contentView
.findViewById(R.id.lv_ppw_settings_lists);
String[] menuItems = context.getResources().getStringArray(R.array.associator_query_menu);
PopupSettingsAdapter adapter = new PopupSettingsAdapter(context, menuItems);
....
}
我都用了wrap_content了
然而结果却是:
醉了,这是什么缘故。。。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
因为wrap_content对ListView是不起效的,没有明确的width hight,默认都是会撑满。
。。用popupMenu吧。。那才是你想要的效果,并且比你这个简单美观多了
可能是ListView 的item的布局问题吧