繁体   English   中英

Galaxy Nexus使用哪种布局

[英]Which layout is used for 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>

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

TabHost已过时 ,建议您改用Fragments

试用ActionBarSherlock

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

该库将在适当时自动使用本机操作栏,或自动在布局中包装自定义实现。 这样一来,您便可以轻松针对2.x及更高版本的每个Android版本使用操作栏来开发应用程序。

教程:

教程1教程2教程3

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM