xml对话框没有显示我的包含

时间:2014-04-09 13:50:17

标签: java android xml

我有自定义对话框,对话框已连接XML填充xml填充我没有看到它给我“渲染问题”的视觉xml视图,当我运行应用程序和对话框显示我看到背景对话框是黑色的,我只看到EditText的 并告诉我这个例外:

Exeption:

 java.lang.IllegalArgumentException: Empty region!
        at javax.imageio.ImageReader.computeRegions(ImageReader.java:2689)
        at com.sun.imageio.plugins.wbmp.WBMPImageReader.read(WBMPImageReader.java:184)
        at javax.imageio.ImageIO.read(ImageIO.java:1422)
        at javax.imageio.ImageIO.read(ImageIO.java:1282)
        at android.graphics.Bitmap_Delegate.createBitmap(Bitmap_Delegate.java:118)
        at android.graphics.Bitmap_Delegate.createBitmap(Bitmap_Delegate.java:102)
        at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:233)
        at com.android.layoutlib.bridge.bars.CustomBar.loadIcon(CustomBar.java:212)
        at com.android.layoutlib.bridge.bars.CustomBar.loadIconById(CustomBar.java:204)
        at com.android.layoutlib.bridge.bars.CustomBar.loadIconById(CustomBar.java:171)
        at com.android.layoutlib.bridge.bars.FakeActionBar.<init>(FakeActionBar.java:38)
        at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:346)
        at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:336)
        at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:332)
        at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:548)
        at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:537)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:929)
        at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:537)
        at com.android.tools.idea.rendering.RenderService.render(RenderService.java:609)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:575)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:81)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$6$1.run(AndroidLayoutPreviewToolWindowManager.java:521)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
        at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$6.run(AndroidLayoutPreviewToolWindowManager.java:516)
        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.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
        at com.intellij.util.Alarm$Request$1.run(Alarm.java:297)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:695)

xml fill:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="10">

            <LinearLayout
                android:orientation="vertical"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">

                <LinearLayout
                    android:orientation="vertical"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1">

                    <ImageView
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:id="@+id/btnimageEdit"
                        android:src="@drawable/spanner32" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textColor="#ff0007"
                        android:id="@+id/txtError" />
                </LinearLayout>

                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="89dp">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:text="Website:"
                        android:id="@+id/textView"
                        android:paddingRight="15dp" />

                    <TextView
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:id="@+id/textWebSite"
                        android:linksClickable="false"
                        android:textColor="#0001ff" />

                    <EditText
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textEmailAddress"
                        android:ems="10"
                        android:id="@+id/editWebSite"
                        android:text="For example: www.google.com"
                        android:textStyle="italic" />

                </LinearLayout>

                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="51dp"
                    android:id="@+id/linearLayout2">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:text="Login:"
                        android:id="@+id/textView3"
                        android:paddingRight="15dp" />

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:id="@+id/textUserName" />

                    <EditText
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textEmailAddress"
                        android:ems="10"
                        android:id="@+id/editUserName" />
                </LinearLayout>

                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="52dp"
                    android:id="@+id/linearLayout">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:text="Password:"
                        android:id="@+id/textView2"
                        android:paddingRight="15dp" />

                    <ImageView
                        android:layout_width="20dp"
                        android:layout_height="fill_parent"
                        android:id="@+id/btnShowPass"
                        android:src="@drawable/showpass_icon"
                        android:paddingBottom="20dp" />

                    <TextView
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:id="@+id/textPass"
                        android:inputType="textPassword" />

                    <EditText
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:inputType="text"
                        android:ems="10"
                        android:id="@+id/editPass" />
                </LinearLayout>

                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="47dp"
                    android:id="@+id/linearLayout3">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:text="More:"
                        android:id="@+id/textView4"
                        android:paddingRight="15dp" />

                    <TextView
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:id="@+id/textMore" />

                    <EditText
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textMultiLine"
                        android:ems="10"
                        android:id="@+id/editMore" />
                </LinearLayout>
            </LinearLayout>

        </LinearLayout>
    </LinearLayout>
</LinearLayout>

1 个答案:

答案 0 :(得分:0)

检查各自文件夹中的图片。确保它们没有损坏。并确保所有格式均为.png