简体   繁体   中英

android XML view Does not display ToggleButton in Eclipse

In my android XML Graphical Layout, I am unable to display my ToggleButton . I receive some errors (see below). Also, I am not able to edit anything else using the Graphical Layout.

<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>

Error :

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)

Go to your graphical layout and locate the drop down of the API levels, probably you are using the last one 21, and you don´t have it installed, change to other lever according to your app.

在此处输入图片说明

I think You haven't got the right android packages installed. Make sure your API is set to the correct one (As in not android wear). Just click on you SDK manager and install the correct api. including all the extras. cheers !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM