Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行 customCityPicker.showCityPicker();时出错 #212

Open
18685009019 opened this issue Mar 23, 2021 · 4 comments
Open

执行 customCityPicker.showCityPicker();时出错 #212

18685009019 opened this issue Mar 23, 2021 · 4 comments

Comments

@18685009019
Copy link

android.content.res.Resources$NotFoundException: Resource ID #0xfffffba9
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:220)
at android.content.res.MiuiResourcesImpl.getValue(MiuiResourcesImpl.java:94)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2160)
at android.content.res.Resources.getLayout(Resources.java:1157)
at android.view.LayoutInflater.inflate(LayoutInflater.java:425)
at com.lljjcoder.style.citypickerview.widget.wheel.adapters.AbstractWheelTextAdapter.getView(AbstractWheelTextAdapter.java:283)
at com.lljjcoder.style.citypickerview.widget.wheel.adapters.AbstractWheelTextAdapter.getItem(AbstractWheelTextAdapter.java:201)
at com.lljjcoder.style.citypickerview.widget.wheel.WheelView.getItemView(WheelView.java:1049)
at com.lljjcoder.style.citypickerview.widget.wheel.WheelView.addViewItem(WheelView.java:1002)
at com.lljjcoder.style.citypickerview.widget.wheel.WheelView.buildViewForMeasuring(WheelView.java:988)
at com.lljjcoder.style.citypickerview.widget.wheel.WheelView.onMeasure(WheelView.java:639)
at android.view.View.measure(View.java:22097)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1148)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:687)
at android.view.View.measure(View.java:22097)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6606)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
at android.view.View.measure(View.java:22097)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6606)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.view.View.measure(View.java:22097)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6606)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.view.View.measure(View.java:22097)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2467)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1549)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1806)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6886)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1029)
at android.view.Choreographer.doCallbacks(Choreographer.java:841)
at android.view.Choreographer.doFrame(Choreographer.java:772)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1015)
at android.os.Handler.handleCallback(Handler.java:794)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)

@15239545925
Copy link

我也是也遇到了这个问题,请问你也有解决吗

@s675660665
Copy link

用自己定义的布局,默认加载的布局id是-1,所以报错
.setCustomItemLayout()
.setCustomItemTextViewId()

@s675660665
Copy link

我也是也遇到了这个问题,请问你也有解决吗

参见我上边的回答

@daonvshu
Copy link

我发现是因为CustomCityPicker第287行位置,在尝试比较两个不同的Integer对象造成,一个是CustomConfig.NONE,一个是CityConfig.NONE,而这个NONE值用的-1111,不在整型常量池范围内,所以运算符!=会返回true而加载错误的布局。看作者貌似没有维护了,要么使用自定义布局,要么克隆源代码使用equals比较两个值

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants