android Popwindow中spinner点击崩溃挂掉的解决方法
16lz
2021-01-26
最近的项目中遇到listview中弹出框里面嵌套一个spinner,但是反复调试尝试后总是崩溃,调试后在这个位置出错(高亮部分):
(){height=buildDropDown()noInputMethod=isInputMethodNotNeeded().setAllowScrollingAnchorParent(!noInputMethod).setWindowLayoutType()(.isShowing()){widthSpec(==ViewGroup.LayoutParams.){widthSpec=-}(==ViewGroup.LayoutParams.){widthSpec=getAnchorView().getWidth()}{widthSpec=}heightSpec(==ViewGroup.LayoutParams.){heightSpec=noInputMethod?height:ViewGroup.LayoutParams.(noInputMethod){.setWidth(==ViewGroup.LayoutParams.?ViewGroup.LayoutParams.:).setHeight()}{.setWidth(==ViewGroup.LayoutParams.?ViewGroup.LayoutParams.:).setHeight(ViewGroup.LayoutParams.)}}(==ViewGroup.LayoutParams.){heightSpec=height}{heightSpec=}.setOutsideTouchable(!&&!).update(getAnchorView()(widthSpec<)?-:widthSpec(heightSpec<)?-:heightSpec)}{widthSpec(==ViewGroup.LayoutParams.){widthSpec=ViewGroup.LayoutParams.}{}heightSpec(==ViewGroup.LayoutParams.){heightSpec=ViewGroup.LayoutParams.}{(==ViewGroup.LayoutParams.){heightSpec=height}{heightSpec=}}.setWidth(widthSpec).setHeight(heightSpec).setClipToScreenEnabled().setOutsideTouchable(!&&!).setTouchInterceptor().showAsDropDown(getAnchorView()).setSelection(ListView.)(!||.isInTouchMode()){clearListSelection()}(!){.post()}}}
后来在AndroidManifest.xml中加入这个主题属性就可以了(红色部分):
<activity android:name=".team.TeamMate"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Light.NoTitleBar" />
调试的机型为HUAWEI android4.4.2。
更多相关文章
- phonegap+jquerymobile开发android的心得(2)
- android之ScrollView里嵌套ListView(转)
- android wifi调试总结 theros AR6K命令小结 android wifi debug
- delphi XE 5 Android(安卓)真机调试简易安装教程
- Mac 进行 android 真机调试
- Ubuntuecplise中连接Android真机…
- 【Android(安卓)初学】6、线性布局--深入LinearLayout
- Android之蓝牙startDiscovery()搜索不到设备
- 更新Android(安卓)SDK 出错 Failed to rename directory \temp