3

写代码才是真正的难题,
先跟着一个类似的教程,添加了网络权限和调用存储的权限,因为现在想先做个调用虚拟机内照片来进行人脸检测的简易app。
另外还要导入人脸识别的这个依赖。



主页面<androidx.constraintlayout.widget.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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<Button
    android:id="@+id/button_record_mood"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginTop="292dp"
    android:layout_marginEnd="16dp"
    android:layout_marginBottom="387dp"
    android:text="记录我的心情⭐"
    android:textSize="22sp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.497"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/imageView2"
    tools:ignore="UnknownId" />
<ImageView
    android:id="@+id/imageView"
    android:layout_width="227dp"
    android:layout_height="223dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.072"
    app:srcCompat="@drawable/pic"
    tools:ignore="MissingConstraints" />

</androidx.constraintlayout.widget.ConstraintLayout>

posted @ 2024-07-01 11:12  Ni说的都队  阅读(11)  评论(0)    收藏  举报