简体   繁体   English

为什么图形布局(适用于Android)没有出现在Eclipse中?

[英]Why Graphical layout (for android) doesn't appear in Eclipse?

I have created a complete new project in Eclipse. 我已经在Eclipse中创建了一个完整的新项目。 Now I want to use the design mood for drag-drop. 现在,我想使用设计心情进行拖放。 But unfortunately the graphical layout isn't showing. 但是不幸的是没有显示图形布局。 There is a place which is similar to graphical layout (that I have shown in picture), but it doesn't work and it's not possible to drop something there. 有一个类似于图形布局的地方(我已在图片中显示),但是它不起作用,无法在此处放置某些东西。 How could I fix this? 我该如何解决?

在此处输入图片说明

At the bottom there are some error NullPointerException. 在底部有一些错误NullPointerException。 This is how it looks: 它是这样的:

在此处输入图片说明

.XML file for the layout: 布局的.XML文件:

    <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.example.alarm_hkr.MainActivity" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />

</RelativeLayout>

At the bottom, there is some NullPoiterException showing. 在底部,显示了一些NullPoiterException I suppose there is something wrong with some custom view you are using. 我想您正在使用的某些自定义视图有问题。 Try to fix that and post some more details if you don't find the error.. 如果找不到错误,请尝试解决此问题并发布更多详细信息。

Try to use another android version for rendering layouts. 尝试使用另一个android版本渲染布局。 Set 21 or less. 设置为21以下。 Helps for me. 对我有帮助。 (It's green android figure with number 22 on your screenshot.) (这是绿色的Android图形,屏幕截图上的数字为22。)

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

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