Galaxy Nexus采用哪种布局

时间:2013-09-17 12:35:24

标签: android layout galaxy-nexus

我可以将哪种布局用于Nexus 4和Galaxy Nexus?

Nexus 7(800 x 1280)与Galaxy Nexus(720 x 1280)之间存在冲突 截图:

Nexus S

Nexus S

Galaxy Nexus

Galaxy Nexus

修改

home_screen.xml

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

<WebView
    android:id="@+id/web_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone" />

<TabHost
    android:id="@+id/tabHost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

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

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1" >

            <include layout="@layout/home_tab_list" />

        </FrameLayout>

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0"
            android:background="@drawable/tab_bar_background" >
        </TabWidget>
    </LinearLayout>
</TabHost>

home_tab_list.xml

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

<RelativeLayout
    android:id="@+id/tab_list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:visibility="visible" >

    <ImageView
        android:id="@+id/glob"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="20dp"
        android:contentDescription="@string/profile_picture_description"
        android:src="@drawable/globe" />

  <ImageView
        android:id="@+id/createTrip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/pickMatches"
        android:layout_alignLeft="@+id/glob"
        android:layout_marginBottom="35dp"
        android:layout_marginLeft="21dp"
        android:contentDescription="@string/profile_picture_description"
        android:src="@drawable/create_trip_background" />

    <ImageView
        android:id="@+id/pickMatches"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/glob"
        android:layout_marginBottom="24dp"
        android:layout_marginLeft="80.5dp"
        android:contentDescription="@string/profile_picture_description"
        android:src="@drawable/pick_matches_background" />

    <ImageView
        android:id="@+id/meetMatch"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/createTrip"
        android:layout_marginRight="12dp"
        android:clickable="true"
        android:contentDescription="@string/profile_picture_description"
        android:src="@drawable/meet_match_background" />
</RelativeLayout>

请指导我。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

不推荐使用TabHost ,建议您改用 Fragments

试用ActionBarSherlock

  

ActionBarSherlock是支持库的扩展,旨在通过单个API在所有Android版本中使用操作栏设计模式。

     

库将在适当时自动使用本机操作栏,或者将自动在您的布局周围包装自定义实现。这使您可以从2.x及更高版本为每个Android版本轻松开发带有操作栏的应用程序。

教程:

tutorial 1tutorial 2tutorial 3

如果您真的想使用TabHost,也许其他人可以提供帮助。我对此没有多少经验。祝你好运!

相关问题