【发布时间】:2019-01-21 00:03:45
【问题描述】:
正如您在此处看到的,按钮的背景是透明的。我似乎无法在任一 xml 文件中找到它设置为白色的位置。该按钮标识为btnCapture,代码如下。
activity_main.xml
<RelativeLayout
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/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextureView
android:id="@+id/textureView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btnCapture" />
<Button
android:text="@string/capture"
android:id="@+id/btnCapture"
android:layout_width="wrap_content"
android:layout_height="92dp"
android:background="@drawable/rounded_button"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
tools:layout_editor_absoluteX="157dp"
tools:layout_editor_absoluteY="202dp" />
</RelativeLayout>
rounded_button.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke android:color="#80000000"
android:width="2dp"></stroke>
<stroke android:color="#D3D3D3"></stroke>
<size android:width="60dp"
android:height="80dp"></size>
</shape>
【问题讨论】:
-
问题与 Java 无关。使用您的
rounded_button.xml文件的快照更新问题。这就是问题所在。 -
@Taslim 完成。但是仍然看不到该文件中的问题所在。
-
我已经回答了你的问题。
标签: java android xml android-studio