首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android :需要像超级应用那样精确地设计吗?

Android :需要像超级应用那样精确地设计吗?
EN

Stack Overflow用户
提问于 2015-10-27 19:46:50
回答 1查看 66关注 0票数 0

正如我在这个链接在这里输入链接描述中提到的那样,我设计了一个布局,

第一布局包含3个图标,这将像一个动作图标和第二个布局包含我的CardStack。

代码语言:javascript
复制
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:background="@color/colorPrimaryDark"
    android:layout_height="match_parent">


    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal" android:layout_width="match_parent"
        android:background="@android:color/transparent"
        android:weightSum="3"

        android:gravity="center_vertical"
        android:layout_height="?attr/actionBarSize">


        <ImageView
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_gravity="left"

            android:layout_height="match_parent"
            android:src="@drawable/ic_list"
            android:id="@+id/tab1"
            android:padding="12dp" />

        <ImageView
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_gravity="left"

            android:layout_height="match_parent"
            android:src="@drawable/ic_connect"
            android:id="@+id/tab2"
            android:padding="12dp" />

        <ImageView
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_gravity="left"

            android:layout_height="match_parent"
            android:src="@drawable/ic_chat"
            android:id="@+id/tab3"
            android:padding="12dp" />

    </LinearLayout>

    <FrameLayout
        android:id="@+id/pager"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />


</RelativeLayout>

由于我已经给出了一个链接,同样我需要实现,但我做不到,请帮助我解决这个问题。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-10-27 20:43:28

更改xml文件中布局的顺序:将FrameLayout (CardStack的第二个布局)放在LinearLayout (3个图标的第一个布局)之前,如下所示:

代码语言:javascript
复制
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorPrimaryDark">

    <FrameLayout
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@android:color/transparent"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:weightSum="3">

        <ImageView
            android:id="@+id/tab1"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="left"
            android:layout_weight="1"
            android:padding="12dp"
            android:src="@drawable/ic_list" />

        <ImageView
            android:id="@+id/tab2"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="left"
            android:layout_weight="1"
            android:padding="12dp"
            android:src="@drawable/ic_connect" />

        <ImageView
            android:id="@+id/tab3"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="left"
            android:layout_weight="1"
            android:padding="12dp"
            android:src="@drawable/ic_chat" />

    </LinearLayout>

</RelativeLayout>

这就是你要找的吗?

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

https://stackoverflow.com/questions/33377153

复制
相关文章

相似问题

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