android布局突然搞砸了

时间:2013-11-19 15:39:35

标签: android android-layout layout

我正在开发一个应用程序,突然布局在Android 2.2和2.3.5中搞砸了。但它们在android 4及以上看起来很好。我在布局上做了一些改变,包括一些文字大小调整,填充和边距,然后它搞砸了。我备份了以前的工作代码(我总是这样做),所以我更换了它并刷新了项目,但布局仍然搞砸了。

注意:我正在使用adt-bundle-windows-x86_64-20130514

主要布局              

    <RelativeLayout 
        android:id="@+id/top_date_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:paddingTop="@dimen/first_page_top_white_bar_padding_top"
        android:paddingBottom="@dimen/first_page_top_white_bar_padding_button">

        <ImageButton 
            android:id="@+id/update_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/refresh_icon"
            android:background="@null"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginRight="@dimen/titlebar_first_icon_margin_right"/>

        <ImageView 
            android:id="@+id/clock_image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/clock_icon"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:layout_marginLeft="@dimen/titlebar_other_icon_margin_right"/>

        <TextView 
            android:id="@+id/date_from_web_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/clock_image"
            android:layout_centerVertical="true"
            android:text="@string/date_from_web_string"/>

    </RelativeLayout>

    <RelativeLayout 
        android:id="@+id/first_page_helal_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"        
        android:background="@drawable/first_page_helal_icon_background"
        android:layout_below="@id/top_date_bar"
        android:layout_centerHorizontal="true"
        android:paddingLeft="@dimen/first_page_helal_layout_padding_left_right"
        android:paddingRight="@dimen/first_page_helal_layout_padding_left_right"
        android:paddingTop="@dimen/first_page_helal_layout_padding_top_buttom"
        android:paddingBottom="@dimen/first_page_helal_layout_padding_top_buttom"
        android:layout_marginTop="@dimen/first_page_helal_layout_margin_top">

        <ImageView 
            android:id="@+id/moon_image"
            android:layout_width="@dimen/helal_image_maxwidth"
            android:layout_height="@dimen/helal_image_maxwidth"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:src="@drawable/moon_icon"
            android:layout_marginRight="@dimen/helal_image_margin_right"/>

        <TextView 
            android:id="@+id/first_page_month_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/moon_image"
            android:layout_centerVertical="true"
            android:text="@string/moharam"
            android:textColor="@color/white"
            android:layout_marginRight="@dimen/helal_image_margin_right"/>

        <TextView 
            android:id="@+id/maalomat_helal_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/first_page_month_text"
            android:layout_centerVertical="true"
            android:text="@string/first_page_maalomat_helal_string"
            android:textColor="@color/white"/>

    </RelativeLayout>

    <ExpandableListView
        android:id="@+id/first_page_expand_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:groupIndicator="@null"
        android:layout_below="@id/first_page_helal_layout" 
        android:layout_marginTop="@dimen/first_page_expand_list_margin_top"
        android:layout_marginLeft="@dimen/first_page_expand_list_margin_left_right"
        android:layout_marginRight="@dimen/first_page_expand_list_margin_left_right"
        android:scrollbars="none"
        android:cacheColorHint="@color/transparent"
        android:divider="@color/transparent"
        android:childDivider="@color/transparent"/>

</RelativeLayout>

组视图                  

    <RelativeLayout 
        android:id="@+id/innerLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clickable="true">

        <TextView
            android:id="@+id/group_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:text="Group Title"          
            android:textColor="@color/black"
            android:layout_marginRight="@dimen/first_page_group_margin_right"/>

        <ImageView
            android:id="@+id/group_icon"
            android:layout_width="@dimen/first_page_button_icon_maxwidth"
            android:layout_height="@dimen/first_page_button_icon_maxwidth"
            android:scaleType="fitXY"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:src="@drawable/date_icon"
            android:layout_marginLeft="@dimen/first_page_group_margin_left"/>

        <ImageView
            android:id="@+id/group_lines"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/first_page_button_lines_maxheight"
            android:scaleType="centerCrop"
            android:layout_toRightOf="@id/group_icon"
            android:layout_centerVertical="true"
            android:src="@drawable/blue_lines_icon"
            android:alpha="0.1"/>

    </RelativeLayout>

    <ImageView
        android:id="@+id/expandable_image"
        android:layout_width="@dimen/first_page_expand_icon_maxwidth"
        android:layout_height="@dimen/first_page_expand_icon_maxheight"
        android:scaleType="fitXY"
        android:layout_below="@id/innerLayout"
        android:layout_centerHorizontal="true"
        android:src="@drawable/expand_icon"/>

</RelativeLayout>

儿童观点              

    <TextView 
        android:id="@+id/child_title"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:text="Child Title"
        android:textColor="@color/black"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"/>

</RelativeLayout>

android 4.2
enter image description here

android 2.2
enter image description here

1 个答案:

答案 0 :(得分:0)

好的,更新到ADT-22.3.0 问题解决了