zoukankan      html  css  js  c++  java
  • Android布局

    1.使用帧布局自定义照相机

    <?xml version="1.0" encoding="utf-8"?>

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"

        xmlns:tools="http://schemas.android.com/tools"

        android:id="@+id/camera"

        android:layout_width="match_parent"

        android:layout_height="match_parent" >

        <!-- 显示预览图形 -->

        <SurfaceView

            android:id="@+id/surfaceView"

            android:layout_width="match_parent"

            android:layout_height="match_parent" />

        <!-- 头部取消、翻转、闪光灯 -->

        <RelativeLayout

            android:id="@+id/top"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:background="@drawable/photograph_top_bg" >

            <ImageView

                android:id="@+id/cancel"

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:layout_centerVertical="true"

                android:layout_marginLeft="3dp"

                android:src="@drawable/photograph_cancel" />

            <ImageView

                android:id="@+id/flip"

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:layout_centerInParent="true"

                android:src="@drawable/photograph_flip" />

            <ImageView

                android:id="@+id/spark_self"

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:layout_alignParentRight="true"

                android:layout_centerVertical="true"

                android:layout_marginRight="3dp"

                android:src="@drawable/photograph_spark_self" />

        </RelativeLayout>

        <!-- 整理照片 -->

        <LinearLayout

            android:id="@+id/photographs"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_gravity="bottom"

            android:background="@drawable/photograph_down_bg"

            android:orientation="horizontal" >

        </LinearLayout>

        <!-- 底部从相册选择、拍照、下一步 -->

        <RelativeLayout

            android:id="@+id/bottom"

            android:layout_width="wrap_content"

            android:layout_height="60dp"

            android:layout_gravity="bottom"

            android:background="@drawable/photograph_bottom_bg" >

            <ImageView

                android:id="@+id/pickphoto"

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:layout_centerVertical="true"

                android:layout_marginLeft="15dp"

                android:src="@drawable/photograph_pickphoto" />

            <ImageView

                android:id="@+id/takephoto"

                android:layout_width="60dp"

                android:layout_height="40dp"

                android:layout_centerInParent="true"

                android:src="@drawable/photograph_takephoto" />

            <TextView

                android:id="@+id/next"

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:layout_alignParentRight="true"

                android:layout_centerVertical="true"

                android:paddingRight="10dp"

                android:text="下一步"

                android:textColor="#ffffff"

                android:textSize="18sp" />

        </RelativeLayout>

    </FrameLayout>

    效果图:

  • 相关阅读:
    V2热帖:要多健壮的代码才能支撑起千变万化的需求?
    jmeter生成html报告的命令
    jmeter5.x&4.x搭配使用Serveragent 监听服务端性能参数
    springboot关于tomcat的几个默认配置
    nginx日志统计分析-shell
    OpenStack虚拟机VIP配置步骤
    openstack 3.14.3 虚拟机增加指定IP网卡
    OpenStack各组件的常用命令
    Filebeat的Registry文件解读
    一个shell脚本的实践
  • 原文地址:https://www.cnblogs.com/bianmajiang/p/3986696.html
Copyright © 2011-2022 走看看