【发布时间】:2018-12-27 15:05:56
【问题描述】:
尝试创建一个带有几个 ImageButtons 的应用程序来播放声音。由于我添加到drawable文件夹的图像很大,认为它们会造成麻烦;因此使用启动器图像进行了测试,但出现了同样的错误。受够了这个烦人的麻烦..请提出一条出路..
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="28dp"
android:layout_marginLeft="28dp"
android:layout_marginTop="26dp"
android:background="null"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
app:srcCompat="@mipmap/ic_launcher_round" />
<ImageButton
android:id="@+id/imageButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/imageButton1"
android:layout_centerHorizontal="true"
android:background="null"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
app:srcCompat="@mipmap/ic_launcher" />
</RelativeLayout>
【问题讨论】:
-
请发布您面临的错误
标签: android imagebutton