首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Galaxy采用哪种布局

Galaxy采用哪种布局
EN

Stack Overflow用户
提问于 2013-09-17 12:35:23
回答 1查看 360关注 0票数 0

Nexus 4和Galaxy可以使用哪种布局?

Nexus 7(800 X 1280)和Galaxy Nexus(720 X 1280)之间存在冲突,如截图中所附:

Nexus S

Galaxy

编辑

home_screen.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>

代码语言:javascript
复制
<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

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>

代码语言:javascript
复制
<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>

请指导我的this.Any帮助将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2013-09-17 13:31:31

TabHost是不推荐使用的,建议您使用片断

试试ActionBarSherlock

ActionBarSherlock是支持库的扩展,旨在通过一个API在所有版本的Android中方便使用动作条设计模式。 库将在适当时自动使用本机操作栏,或者在布局周围自动包装自定义实现。这使您可以轻松地为2.x和更高版本的Android的每个版本开发一个带有操作栏的应用程序。

教程:

教程1教程2教程3

如果您真的想使用TabHost,也许其他人可以帮助您。我在这方面经验不多。祝好运!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18850037

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档