[英]android.view.InflateException: Binary XML file line #27: Error inflating class android.widget.ToggleButton
[英]android XML view Does not display ToggleButton in Eclipse
在我的Android XML圖形布局中,我無法顯示ToggleButton
。 我收到一些錯誤(請參閱下文)。 另外,我無法使用圖形布局編輯其他任何內容。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.thunder4apps.lanterna.corinthians.MainActivity" >
<ToggleButton
android:id="@+id/togglebutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOn="Vibrate on"
android:textOff="Vibrate off"
android:onClick="onToggleClicked"/>
</RelativeLayout>
錯誤:
Exception raised during rendering: -1
Exception details are logged in Window > Show View > Error LogThe graphics preview in the layout editor may not be accurate:
Different corner sizes are not supported in Path.addRoundRect. (Ignore for this session)
Path.isConvex is not supported. (Ignore for this session)
轉到圖形布局並找到API級別的下拉列表,可能您使用的是最后一個21,但尚未安裝,請根據您的應用更改為其他方法。
我認為您尚未安裝正確的android軟件包。 確保您的API設置為正確的API(與非Android Wear一樣)。 只需單擊您的SDK管理器並安裝正確的api。 包括所有其他內容。 歡呼!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.