简体   繁体   English

android XML视图在Eclipse中不显示ToggleButton

[英]android XML view Does not display ToggleButton in Eclipse

In my android XML Graphical Layout, I am unable to display my ToggleButton . 在我的Android XML图形布局中,我无法显示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. 转到图形布局并找到API级别的下拉列表,可能您使用的是最后一个21,但尚未安装,请根据您的应用更改为其他方法。

在此处输入图片说明

I think You haven't got the right android packages installed. 我认为您尚未安装正确的android软件包。 Make sure your API is set to the correct one (As in not android wear). 确保您的API设置为正确的API(与非Android Wear一样)。 Just click on you SDK manager and install the correct api. 只需单击您的SDK管理器并安装正确的api。 including all the extras. 包括所有其他内容。 cheers ! 欢呼!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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