mSp_UserFloor = (Spinner) findViewById(R.id.sp_userFloor);
mSp_UserFloor.setOnItemSelectedListener(listenerFloor);
try {
Field popup = Spinner.class.getDeclaredField("mPopup");
popup.setAccessible(true);
android.widget.ListPopupWindow popupWindow = (android.widget.ListPopupWindow) popup.get(mSp_UserFloor);
// 设置下视视图的高度
popupWindow.setHeight(200);
}
catch (Exception e) {
}
Android中限制Spinner下拉视图高度
最新推荐文章于 2023-04-05 20:53:33 发布