各位大佬好,刚刚接触Android studio 不会画界面想急求帮助
大概的意思就是一个界面有两个视窗,上半部分是拍照显示,下半部分两个button一个是拍照一个是上传,上传的接口我自己做,我只需要一个视窗呀,下面是两个文本框显示返回数据的,感谢急求帮助
感激啊,求助各位大佬,学生作业呐
直接拖控件就行,as现在很智能
大佬推荐你一本书,《android 开发从入门到放弃》,不会就多看些基础视频学啊,这还需要等着别人帮你啊,出来工作很多东西都是要自己学的
我教你一招,直接百度拍照 上传 里面啥都有,不然的话,你的坑是填不满的。因为我看出你是对安卓一窍不通不同
上面几位仁兄说的不错 找几个视频看看 关于这个问题 根据你的草图 我给你做个简约的实例 你也可以看一下 希望能帮助你解决一些思路问题
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scaleType="centerCrop"
android:src="@mipmap/bg"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<Button
android:id="@+id/take_camarebt"
android:layout_centerVertical="true"
android:layout_marginLeft="60dp"
android:layout_width="80dp"
android:layout_height="80dp"
android:text="拍"
android:gravity="center"
android:textSize="15sp"
android:background="@drawable/button_round_bg"/>
<Button
android:id="@+id/up_loadbt"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_marginRight="60dp"
android:layout_width="80dp"
android:layout_height="80dp"
android:text="上"
android:gravity="center"
android:textSize="15sp"
android:background="@drawable/button_round_bg"/>
<TextView
android:id="@+id/pro_hinttv"
android:gravity="center"
android:textSize="15sp"
android:layout_alignRight="@+id/up_loadbt"
android:layout_marginTop="15dp"
android:layout_below="@+id/up_loadbt"
android:background="@drawable/tv_rect_bg"
android:layout_width="100dp"
android:layout_height="35dp"
android:text="xx"/>
<TextView
android:id="@+id/upload_hinttv"
android:layout_toLeftOf="@+id/pro_hinttv"
android:gravity="center"
android:textSize="15sp"
android:layout_marginRight="20dp"
android:layout_marginTop="15dp"
android:layout_below="@+id/up_loadbt"
android:background="@drawable/tv_rect_bg"
android:layout_width="100dp"
android:layout_height="35dp"
android:text="正在上传"/>
</RelativeLayout>
</LinearLayout>
还是从基础开始,好好学习Android开发
问这个问题就说明你对andorid一无所知,最基本的布局都不会画,所以还是要从基础学起,不要动不动就叫别人帮你写
如果你要上传的是拍照的内容,那么上半部分应该是从摄像头获取的数据,所以imageView不妥,建议使用SurfaceView或者TextureView。
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<SurfaceView
android:id="@+id/img_surface"
android:layout_width="match_parent"
android:layout_height="263dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btn_photo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="拍照"
app:layout_constraintEnd_toEndOf="@+id/tv_status"
app:layout_constraintStart_toStartOf="@+id/tv_status"
tools:layout_editor_absoluteY="322dp" />
<Button
android:id="@+id/btn_upload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="上传"
app:layout_constraintEnd_toEndOf="@+id/tv_result"
app:layout_constraintStart_toStartOf="@+id/tv_result"
tools:layout_editor_absoluteY="322dp" />
<TextView
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="正在上传"
tools:layout_editor_absoluteX="101dp"
tools:layout_editor_absoluteY="415dp" />
<TextView
android:id="@+id/tv_result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="xx"
tools:layout_editor_absoluteX="249dp"
tools:layout_editor_absoluteY="415dp" />
</android.support.constraint.ConstraintLayout>