【发布时间】:2021-04-01 01:08:10
【问题描述】:
我正在开发一个 android 应用程序,但我偶然发现了一个我无法通过的错误。我所有的研究都让我相信我缺少一些 xml 元素,但我不知道是什么,所以希望有更多专业知识的人能指出这一点。
我得到的视觉工作室错误是
Unhandled Exception:
Android.Views.InflateException: <Timeout exceeded getting exception details>
错误来自我的 roundbutton.xml 文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#536878" />
<corners android:bottomRightRadius="25dp"
android:bottomLeftRadius="25dp"
android:topRightRadius="25dp"
android:topLeftRadius="25dp"/>
</shape>
我正在从我的主要活动 xml 中调用该代码,而调用上述代码的代码是:
<ImageButton
android:src="@mipmap/baseline_settings_white_36"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/settingsButton_zone2"
android:layout_marginBottom="0.0dp"
android:background = "@mipmap/roundbutton"/>
那么,有人看到我在圆形按钮 xml 中遗漏了什么吗?如果我删除 android:background="@mipmap/roundbutton" 然后我不再收到错误并且我的应用程序运行。
提前致谢。
【问题讨论】:
-
您是在没有调试器的情况下运行还是仅在调试时才看到超时?如果仅在调试时发生这种情况,那么当您不调试时会发生什么 - 日志中有任何内容吗?
-
我没有尝试不调试,我可以尝试,但我需要调试我的应用程序,所以希望它能够工作。
-
是的,你肯定需要调试 - 但如果调试只在一种特定情况下失败,那么问题就不是那么大了。
标签: c# android xamarin.android