我正在使用一个应用程序,SurfaceView在用户定义的某些参数下绘制对象.我为应用程序创建了布局,其中包括页眉,页脚,输入(用户输入要绘制的参数)和自定义SurfaceView.
这是简化的布局:
<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:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Custom SurfaceView Layout -->
<org.firengine.myapp.CustomPreview
android:id="@+id/container_content"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- Header Layout: This is basically a Toolbar, with having a top padding of status bar height (see Note). -->
<FrameLayout
android:id="@+id/container_header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/colorTint"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">...</FrameLayout>
<!-- Footer Layout - This is just a container, with having a bottom padding of navigation bar height (see Note). -->
<FrameLayout
android:id="@+id/container_footer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/colorTint" …Run Code Online (Sandbox Code Playgroud)