您好,欢迎访问四川鑫光豪耀机电有限公司!

咨询热线:

18980820575
✕

营山发电机维修,营山柴油发电机维修,品牌发电机维修,发电机维修服务公司

Android实现调用摄像头和相册的方法-创新互联

Android调用摄像头是很方便的。先看一下界面

为周宁等地区用户提供了全套网页设计制作服务,及周宁网站建设行业解决方案。主营业务为成都网站设计、成都做网站、周宁网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

布局文件activity_main.xml源码

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
  android:layout_width="match_parent" 
  android:layout_height="match_parent" 
  android:orientation="vertical" > 
 
  <Button 
    android:id="@+id/take_photo" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:text="启动相机" /> 
 
  <Button 
    android:id="@+id/choose_from_album" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:text="从相册中选择图片" /> 
 
  <ImageView 
    android:id="@+id/picture" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center_horizontal" /> 
 
</LinearLayout> 

友情链接 :