English 中文(简体)
Android 部队在装货时关闭
原标题:Android Emulator Force closes when loading Custom Layout

我在一篇论文中编造了一条习俗。 问题是,在我的习惯布局(申请开始时)的“密码”中,主讲人留下了错误,并 close了! 我不知道为什么。 我曾尝试过另一条习俗,或将其置于主人之首,看来是罚款。

任何可能是错误的想法?


是的,我要说的是, app正在坠毁。 这里是关于习俗布局的Xml代码:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollbars="vertical">

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

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/Name"
            android:id="@+id/name"
            android:textSize="18sp"
            android:gravity="center">
        </TextView>

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

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/Picker"
                android:text="@string/drinkText"
                android:textColor="#303030">
            </TextView>

            <View
                android:layout_height="5dp"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/TimePicker"
                android:text="@string/TimeText"
                android:textColor="#303030">
            </TextView>

            <View 
                android:layout_height="20dp"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@id/EndPicker"
                android:text="@string/EndText"
                android:textColor="#303030">
            </TextView>

            <View
                android:layout_height="5dp"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@id/sortPicker"
                android:text="@string/sortText"
                android:textColor="#303030">
            </TextView>

        </LinearLayout>

        <LinearLayout 
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="10dp"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Categories:"
                android:id="@+id/CategorySelect"/>

            <Spinner
                android:id="@+id/categorySpinner"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:drawSelectorOnTop="true"
                android:prompt="@string/categoriesPrompt"
                android:visibility="visible"/>

        </LinearLayout>

        <LinearLayout 
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="10dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Priority:"
                android:id="@+id/prioritySelect"/>

            <Spinner
                android:id="@+id/prioritySpinner"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawSelectorOnTop="true"
                android:prompt="@string/priorityPrompt"
                android:visibility="visible" android:layout_weight="0.0"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="State:"
                android:id="@+id/stateSelect"/>

            <Spinner
                android:id="@+id/statusSpinner"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawSelectorOnTop="true"
                android:prompt="@string/statusPrompt"
                android:visibility="visible"/>

        </LinearLayout>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="10dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Reminder:"
                android:id="@+id/Reminder"/>

            <Spinner
                android:id="@+id/remindSpinner"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawSelectorOnTop="true"
                android:prompt="@string/remindPrompt"
                android:visibility="visible"/>

        </LinearLayout>

        <LinearLayout 
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="10dp"
            android:background="#FF303030">

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:text="suggestions:"
                android:typeface="sans">
            </TextView>

        </LinearLayout>

    </LinearLayout>

</ScrollView>
问题回答

问题是,你在不包含必要属性的情况下重新提出看法(layout_width)。

<View android:layout_height="5dp"/>

应由你来界定预期的血缘行为,但这里有一个例子可以确定你的问题:

<View android:layout_height="5dp" layout_width="fill_parent" />

安德森开发商的文件显示这些领域是:required(资料来源:rel=“nofollow”http://developer.android.com/guide/topics/resources/layout-resource.html





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签