0

我正在尝试将 changeTextView 和 daysLowTextView 等元素从最外层的 RelativeLayout 移动到标记为 col1、col2、col3 和 col4 的嵌套 LinearLayout 元素,但我的应用程序在打开时会失败。我也删除了所有 LinearLayout 定位。有什么建议么?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mainRelativeLayout"
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"
android:stretchColumns="yes"
android:background="@color/black"
tools:context=".MainActivity" >

<LinearLayout android:id="@+id/center" 
    android:layout_width="1dp" 
    android:layout_height="1dp"
    android:layout_centerHorizontal="true" 
    android:visibility="invisible"
    android:orientation="vertical"/>

<LinearLayout
    android:id="@+id/topRowLinearLayout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/enterSymbolTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/stock_symbol"
        android:textColor="@color/white" />

    <EditText
        android:id="@+id/stockSymbolEditText"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:ems="10"
        android:inputType="text"
        android:textColor="@color/white"
        android:textCursorDrawable="@null" />

    <Button
        android:id="@+id/enterStockSymbolButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/enter_stock_symbol"
        android:textColor="@color/white" />

</LinearLayout>

<TextView
    android:id="@+id/companyNameTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/topRowLinearLayout"
    android:padding="@dimen/activity_horizontal_margin"
    android:layout_toLeftOf="@id/center"
    android:text="Company Name"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:textColor="@color/white" />

<WebView
    android:id="@+id/yahooWebView"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true" />

<TextView
    android:id="@+id/daysLowTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/stock_days_low"
    android:textColor="@color/white" />

<TextView
    android:id="@+id/yearLowTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/stock_year_low"
    android:textColor="@color/white" />

<TextView
    android:id="@+id/daysRangeTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/days_range"
    android:textColor="@color/white" />

<TextView
    android:id="@+id/yearHighTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/stock_year_high"
    android:textColor="@color/white" />

<TextView
    android:id="@+id/changeTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/change"
    android:textColor="@color/white" />

<TextView
    android:id="@+id/daysHighTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/stock_days_high"
    android:textColor="@color/white" />

<TextView
    android:id="@+id/lastTradePriceOnlyTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@id/companyNameTextView"
    android:layout_toRightOf="@id/companyNameTextView"
    android:text="@string/last_trade_price_only"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:textColor="@color/white" />

<!-- Begin 2 columns of data -->

<LinearLayout 
    android:id="@+id/linearLayout1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" 
    android:layout_above="@id/yahooWebView">

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

        <LinearLayout 
            android:id="@+id/col1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical" 
            android:layout_weight="1">


        </LinearLayout>

        <LinearLayout 
            android:id="@+id/col2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical" 
            android:layout_weight="1">



        </LinearLayout>

        <LinearLayout 
            android:id="@+id/col3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical" 
            android:layout_weight="1">

        </LinearLayout>

        <LinearLayout 
            android:id="@+id/col4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical" 
            android:layout_weight="1">

        </LinearLayout>
    </LinearLayout>
</LinearLayout>
<!-- end columns of data -->

</RelativeLayout>
4

1 回答 1

0

出于某种原因,我不得不清理项目,然后它自行修复。

于 2013-06-15T01:47:00.327 回答