我正在使用Android studio 3.0
我已经厌倦了解决这个问题.应用程序不执行它总是显示此错误二进制XML文件行#0:错误膨胀类ImageView
这是我的main_activity.xml,我已经改变了我使用ConstraintLayout的xml
<?xml version="1.0" encoding="utf-8"?>
<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"
tools:context="com.example.razoo.mywages.MainActivity">
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="517dp"
android:contentDescription="@string/button3"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/doctor" />
<Button
android:id="@+id/step1btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@color/colorPrimary"
android:onClick="nextPage"
android:text="@string/button3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.498"
tools:layout_alignParentEnd="true"
tools:layout_alignParentRight="true"
tools:layout_alignParentTop="true"
/>
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:background="@color/colorPrimary"
android:text="@string/button3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_alignParentEnd="true"
tools:layout_alignParentRight="true"
tools:layout_alignParentTop="true" />
Run Code Online (Sandbox Code Playgroud)
主要活动的java代码
public class MainActivity extends Activity {
Button btn1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);//the error point here
btn1 = (Button) …Run Code Online (Sandbox Code Playgroud)