1

我正在使用 IntelliJ Idea 12.1 开发的 Android 应用程序中有两个屏幕。数据库的列表屏幕和输入/编辑屏幕。编辑屏幕的布局文件在 IntelliJ 设计器中呈现,但列表屏幕没有。

列表 XML:

<?xml version="1.0" encoding="utf-8"?>
<com.tjdroid.taskreminder.views.ReminderListView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        >
    <LinearLayout
            android:orientation="vertical"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

        <ListView android:id="@+id/reminder_list"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"/>
        <TextView android:id="@+id/reminder_empty"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/no_reminders"/>
    </LinearLayout>
</com.tjdroid.taskreminder.views.ReminderListView>

编辑 XML:

<?xml version="1.0" encoding="utf-8"?>
<com.tjdroid.taskreminder.views.ReminderEditView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        >
    <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
        <TextView android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/title"/>
        <EditText android:id="@+id/title"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                />
        <Button android:id="@+id/confirm"
                android:text="@string/confirm"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>
    </LinearLayout>
</com.tjdroid.taskreminder.views.ReminderEditView>

渲染错误:

java.lang.Exception: Cannot perform rendering
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel.configureError(AndroidDesignerEditorPanel.java:543)
    at com.intellij.designer.designSurface.DesignerEditorPanel.showError(DesignerEditorPanel.java:404)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$8$3.run(AndroidDesignerEditorPanel.java:417)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:343)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:682)
    at java.awt.EventQueue$3.run(EventQueue.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:686)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:511)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:334)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: org.jetbrains.android.uipreview.RenderingException
    at org.jetbrains.android.uipreview.RenderUtil.renderLayout(RenderUtil.java:195)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$8.run(AndroidDesignerEditorPanel.java:346)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
    at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:289)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

任何想法我在列表屏幕中做错了什么?

谢谢

4

0 回答 0