android中疯狂猜图界面:relative界面是可以叠加的

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/background"
        android:orientation="vertical" >

        <LinearLayout
            android:id="@+id/header_bar"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="horizontal"
            android:paddingLeft="5dp"
            android:paddingRight="5dp" >

            <Button
                android:id="@+id/back_btn"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"  />

            <TextView
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1.5"  />

            <TextView
                android:id="@+id/stage_num"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="0.9"
                android:gravity="center"
                android:textColor="#ffffff"
                android:textSize="10sp"  />

            <TextView
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"  />

            <LinearLayout
                android:layout_width="0sp"
                android:layout_height="match_parent"
                android:layout_marginBottom="5sp"
                android:layout_marginTop="5sp"
                android:layout_weight="1.4"
                android:background="#1D338A"
                android:orientation="horizontal"
                android:paddingLeft="5sp" >

                <ImageView
                    android:id="@+id/coin_img"
                    android:layout_width="0sp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"  />

                <TextView
                    android:id="@+id/coin_text"
                    android:layout_width="0sp"
                    android:layout_height="match_parent"
                    android:layout_weight="2"
                    android:gravity="center"
                    android:textColor="#ffffff"
                    android:textSize="10sp"  />
            </LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0sp"
            android:layout_weight="6.5"
            android:orientation="horizontal" >

            <LinearLayout
                android:layout_width="0sp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical"
                android:paddingLeft="5sp" >

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="0sp"
                    android:layout_weight="1.5"  />

                <Button
                    android:id="@+id/delete_text_btn"
                    android:layout_width="match_parent"
                    android:layout_height="0sp"
                    android:layout_marginBottom="10sp"
                    android:text="30"
                    android:textSize="10sp"
                    android:gravity="center_horizontal"
                    android:paddingTop="30sp"
                    android:layout_weight="1.2"  />

                <Button
                    android:id="@+id/propt_text_btn"
                    android:layout_width="match_parent"
                    android:layout_height="0sp"
                    android:text="90"
                    android:textSize="10sp"
                    android:paddingTop="30sp"
                     android:gravity="center_horizontal"
                    android:layout_weight="1.2"  />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="0sp"
                    android:layout_weight="0.5"  />
            </LinearLayout>

            <RelativeLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="3.5" >

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical"
                    android:paddingLeft="5dp"
                    android:paddingRight="5dp" >

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="0sp"
                        android:layout_weight="1"  />

                    <ImageView
                        android:id="@+id/main_image"
                        android:layout_width="match_parent"
                        android:layout_height="0sp"
                        android:layout_weight="3.5"  />
                    <!-- relative中图片可以叠加,这个LinearLayout在下面 -->
                </LinearLayout>

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

                    <TextView
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_weight="1"  />

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_weight="3"
                        android:orientation="vertical" >

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="0sp"
                            android:layout_weight="0.7"  />

                        <TextView
                            android:id="@+id/answer_type"
                            android:layout_width="match_parent"
                            android:layout_height="0dp"
                            android:layout_weight="0.4"
                            android:gravity="center_horizontal"
                            android:textColor="#ffffff"
                            android:textSize="10sp"  />
 <!-- relative中图片可以叠加,这个LinearLayout在上面 -->

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="0sp"
                            android:layout_weight="3.6"  />

                    </LinearLayout>

                    <TextView
                        android:layout_width="0sp"
                        android:layout_height="match_parent"
                        android:layout_weight="1"  />
                </LinearLayout>
            </RelativeLayout>

            <LinearLayout
                android:layout_width="0sp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical" >
            </LinearLayout>
        </LinearLayout>

        <com.kane.crazyneedkane.view.AnswerView
            android:id="@+id/answer_view"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="2.5" >
        </com.kane.crazyneedkane.view.AnswerView>

        <GridView
            android:id="@+id/select_text_grid"
            android:layout_width="match_parent"
            android:layout_height="0sp"
            android:layout_weight="4"
            android:numColumns="8" >
        </GridView>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="0sp"
            android:layout_weight="0.3"  />
    </LinearLayout>

    <!-- 默认隐藏,答案正确后显示 ,android:background="#dd000000"半透明 ,八个0是全透明 -->
    <LinearLayout
        android:id="@+id/winLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#dd000000"
        android:orientation="horizontal"
        android:visibility="invisible" >

        <TextView
            android:layout_width="0sp"
            android:layout_height="match_parent"
            android:layout_weight="1"  />

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical" >

            <TextView
                android:layout_width="match_parent"
                android:layout_height="0sp"
                android:layout_weight="2"  />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:gravity="center"
                android:text="答案正确"
                android:textColor="#ffffff"
                android:textSize="22dp"  />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="0sp"
                android:layout_weight="1.5"  />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0sp"
                android:layout_marginBottom="20dp"
                android:layout_weight="1"
                android:orientation="horizontal" >

                <TextView
                    android:layout_width="0sp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"  />

                <TextView
                    android:id="@+id/win_stage_num"
                    android:layout_width="0sp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:textColor="#ffffff"
                    android:textSize="10dp"  />

                <TextView
                    android:layout_width="0sp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"  />
            </LinearLayout>
             <TextView
                    android:id="@+id/win_answer_text"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="0.5"
                    android:gravity="center"
                    android:textColor="#ffffff"
                    android:textSize="10dp"  />
              <TextView
                android:layout_width="match_parent"
                android:layout_height="0sp"
                android:layout_weight="2"  />
              <Button android:id="@+id/next_btn"
                  android:layout_width="match_parent"
                  android:layout_height="0dp"
                  android:layout_weight="1" />
               <TextView
                   android:id="@+id/game_over"
                android:layout_width="match_parent"
                android:layout_height="0sp"
                android:layout_weight="1"
                android:text="未完待续"
                android:visibility="invisible"
                android:textColor="#ffffff"
                android:textSize="20dp"
                android:gravity="center"  />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="0sp"
                android:layout_weight="2.5"  />
        </LinearLayout>

        <TextView
            android:layout_width="0sp"
            android:layout_height="match_parent"
            android:layout_weight="1"  />
    </LinearLayout>

</RelativeLayout>

作者:csdn博客 青春张开

返回栏目页:http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/

以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索android
, 界面
, 栏目
, www
, relative
叠加
,以便于您获取更多的相关知识。

时间: 2024-08-03 11:59:11

android中疯狂猜图界面:relative界面是可以叠加的的相关文章

详解Android中App的启动界面Splash的编写方法_Android

一.Splash界面的作用用来展现产品的Logo 应用程序初始化的操作 检查应用程序的版本 检查当前应用程序是否合法注册 二.界面的xml定义写一个布局背景设置为产品的logo图片,再添加一个textview显示版本号. <TextView android:id="@+id/tv_splash_version" android:layout_width="wrap_content" android:layout_height="wrap_conten

android中TabHost的图标(48&#215;48)和文字叠加解决方法

开发过程中,有时候图标稍微大点,比如48×48的时候,文字就会和图标叠加起来,解决方法如下:复制代码 代码如下:TabWidget tw = tabHost.getTabWidget(); for (int i = 0; i < tw.getChildCount(); i++) {     TextView tv=(TextView)tw.getChildAt(i).findViewById(android.R.id.title);     ImageView iv=(ImageView)tw.

android layout-android中如何实现在一个界面中分多层显示不同内容?

问题描述 android中如何实现在一个界面中分多层显示不同内容? 想开发一个手机小应用程序,想在主界面上设三个选项卡类型的层分别显示三个不同风格的图片,这个应如何实现?类似于对话框中的各个选项卡的效果

Android开发实例之登录界面的实现_Android

本文要演示的Android开发实例是如何完成一个Android中的miniTwitter登录界面,下面将分步骤讲解怎样实现图中的界面效果,让大家都能轻松的做出美观的登录界面.        miniTwitter登录界面效果图        先贴上最终要完成的效果图:        miniTwitter登录界面的布局分析        首先由界面图分析布局,基本可以分为三个部分,下面分别讲解每个部分.        第一部分是一个带渐变色背景的LinearLayout布局,关于背景渐变色就不再

Android中使用am命令实现在命令行启动程序详解_Android

在Android中,除了从界面上启动程序之外,还可以从命令行启动程序,使用的是命令行工具am. 复制代码 代码如下: usage: am [subcommand] [options]     start an Activity: am start [-D]         -D: enable debugging     send a broadcast Intent: am broadcast     start an Instrumentation: am instrument [flags

Android中使用am命令实现在命令行启动程序详解

在Android中,除了从界面上启动程序之外,还可以从命令行启动程序,使用的是命令行工具am. 复制代码 代码如下: usage: am [subcommand] [options] start an Activity: am start [-D]         -D: enable debugging send a broadcast Intent: am broadcast start an Instrumentation: am instrument [flags]         -r

Android中这种界面要怎么做呢

问题描述 Android中这种界面要怎么做呢 解决方案 表格布局应该可以解决 解决方案二: 就是一个表格布局吧http://www.cnblogs.com/tinyphp/p/3812486.html 解决方案三: 用一个ListView控件就可以了,自定义 View: 解决方案四: 表格布局界面或者ListView都可以解决.

android中如何实现类似于微博个人首页的设计整个界面可以下拉

问题描述 android中如何实现类似于微博个人首页的设计整个界面可以下拉 android中如何实现类似于微博个人首页的设计整个界面可以下拉,但不是刷新数据 解决方案 SwipeRefreshLayout 解决方案二: 百度搜弹性scrollview 解决方案三: 官方的下拉控件不能拉动整个界面,gitHub上有很多自定义的下拉控件可以实现..不刷新数据的话,只需要在回调方法中不做任何数据更新操作就行: 当然,你也可以自定义下拉控件...主要思路是给listView 添加一个头部!!希望有用 解

android中响应Fragment界面中的控件的问题

问题描述 android中响应Fragment界面中的控件的问题 Fragment界面中 怎么对其中的控件比如按钮添加监听事件?先说好,在onCreateView()跟onActivityCreated()中添加是没有反应的 解决方案 在 fragment中:(点击button弹出toast)@Override public View onCreateView(LayoutInflater inflater ViewGroup container Bundle savedInstanceStat