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>

    效果图:

  • 相关阅读:
    OBJ文件格式详解
    HashMap的用法
    HashMap和Hashtable的区别
    加载物体的方法
    drawSelf(int texId)格式对应
    adb.exe诊断
    Android Eclipse如何用BlueStacks模拟器
    .md5mesh and .md5anim文件介绍
    ubuntu命令行下中文乱码的解决方案 (我采取了其中方案一与方案二,都还没成功—待定)
    Ubuntu下小巧智能的代码编辑器Scribes
  • 原文地址:https://www.cnblogs.com/bianmajiang/p/3986696.html
Copyright © 2011-2022 走看看