zoukankan      html  css  js  c++  java
  • 使用include布局进行布局优化

    <include
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    layout="@layout/include_title" />

    include子页面

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@color/white">
    <RelativeLayout
    android:id="@+id/top_bar"
    android:layout_width="fill_parent"
    android:layout_height="45dp"
    android:background="@color/theme_red"
    >
    <RelativeLayout
    android:id="@+id/title_left"
    android:layout_width="45dp"
    android:layout_height="fill_parent"
    android:background="@drawable/white_to_blackoverlay_btn"
    android:clickable="true"
    android:visibility="gone" >
    <TextView
    android:id="@+id/title_left_tv"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:text="返回"
    android:textColor="@color/white"
    android:textSize="15sp" />
    </RelativeLayout>
    <RelativeLayout
    android:id="@+id/title_left_btn"
    android:layout_width="45dp"
    android:layout_height="fill_parent"
    android:background="@drawable/white_to_blackoverlay_btn"
    android:clickable="true"
    android:visibility="gone" >

    <ImageView
    android:id="@+id/left_icon"
    android:layout_width="20dp"
    android:layout_height="20dp"
    android:layout_centerInParent="true" />
    </RelativeLayout>

    <RelativeLayout
    android:id="@+id/title_right"
    android:layout_width="45dp"
    android:layout_height="fill_parent"
    android:layout_alignParentRight="true"
    android:background="@drawable/white_to_blackoverlay_btn"
    android:clickable="true"
    android:visibility="gone" >
    <ImageView
    android:id="@+id/right_icon"
    android:layout_width="20dp"
    android:layout_height="20dp"
    android:layout_centerInParent="true" />
    </RelativeLayout>

    <RelativeLayout
    android:id="@+id/title_text_right"
    android:layout_width="50dp"
    android:layout_height="fill_parent"
    android:layout_alignParentRight="true"
    android:background="@drawable/white_to_blackoverlay_btn"
    android:clickable="true"
    android:visibility="gone" >
    <TextView
    android:id="@+id/title_right_tv"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:textColor="@color/white"
    android:textSize="15sp" />
    </RelativeLayout>
    <TextView
    android:id="@+id/title_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:text="@string/app_title"
    android:textColor="@color/white"
    android:textSize="18sp" />
    </RelativeLayout>

    </RelativeLayout>

  • 相关阅读:
    One SQL to Rule Them All – an Efficient and Syntactically Idiomatic Approach to Management of Streams and Tables(中英双语)
    Spark 公共篇-InterfaceStability
    ANTLR v4 专业术语集
    Apache Spark as a Compiler: Joining a Billion Rows per Second on a Laptop(中英双语)
    Deep Dive into Spark SQL’s Catalyst Optimizer(中英双语)
    What’s new for Spark SQL in Apache Spark 1.3(中英双语)
    Scala 隐式(implicit)详解
    Introducing Apache Spark Datasets(中英双语)
    darknet-yolov3训练自己的数据集(转)
    NVIDIA显卡,显卡驱动版本,CUDA版本,cudnn版本之间兼容关系及如何选择
  • 原文地址:https://www.cnblogs.com/xiaoshumiao/p/6368206.html
Copyright © 2011-2022 走看看