• 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>

    效果图:

  • 相关阅读:
    Away3d学习笔记2三维世界的四个基本构件
    实验报告2
    实验报告
    WPF基础——Application
    COM技术内幕(笔记)
    关于一个GetLevelDesc函数 的认知问题
    UI库阶段性进展(完成文字列表,样式列表(样式列表可继承))
    UI库阶段性进展
    UI库阶段性进展(按钮初具雏形)
    UI库阶段性进展(button在文本对齐的基础上增加文本偏移让文本位置更精准)
  • 原文地址:https://www.cnblogs.com/bianmajiang/p/3986696.html
Copyright © 2020-2023  润新知