【发布时间】:2018-05-25 05:26:20
【问题描述】:
我用红色标记了它应该是什么,我需要更改组件树的当前元素的属性,我不想删除它们或添加另一个。
文本视图:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true">
<com.camera.test.ui.camera.CameraSourcePreview
android:id="@+id/preview"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.camera.test.ui.camera.GraphicOverlay
android:id="@+id/graphicOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/footer"
android:gravity="center">
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_centerHorizontal="true"
android:background="@drawable/icon"
android:onClick="Categories"
android:text="BUTTON"
android:textColor="#228496"
android:textSize="21sp" />
</RelativeLayout>
</com.camera.test.ui.camera.CameraSourcePreview>
</LinearLayout>
【问题讨论】:
-
你是把这个项目导入android studio还是更新android studio?
-
建议大家了解一下LinearLayout、RelativeLayout、ConstraintLayout的区别。
-
@Wahdat Kashmiri 我改变了当前打开的项目,反正已经有了很好的答案。
标签: android android-layout android-studio user-interface layout