Android Popwindowでspinnerクリッククラッシュドロップの解決方法
2182 ワード
最近のプロジェクトでlistviewのポップアップボックスにspinnerがネストされているのに遭遇しましたが、デバッグを繰り返してみると常にクラッシュし、デバッグ後にこの位置でエラー(ハイライト):
その後AndroidManifestでxmlにこのトピックのプロパティを追加すればいいです(赤い部分):
デバッグの機種はHUAWEI android 4.4.2.
() {
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 android 4.4.2.