问:看完视频课程并进行了快速尝试后.....我无法将TextView更改为Button
activity_main.xml
<RelativeLayout xmlns:android = “ http://schemas.android.com/apk/res/android”
android:layout_width = “ match_parent” android:layout_height = “ match_parent” > <TextView android:layout_width = “ wrap_content” android:layout_height “ = ” wrap_content“ /> android:text =”蚂蚁在早晨醒来时会伸展。“
android:id =“ @ + id / TextView”
</ RelativeLayout>
答:发现了你的问题。复制TextView代码并将其粘贴到下方TextView,现在您要做的就是更改TextView为Button:
<RelativeLayout xmlns:android = “ http://schemas.android.com/apk/res/android”
android:layout_width = “ match_parent” android:layout_height = “ match_parent” > <TextView android:layout_width = “ wrap_content” android:layout_height = “ wrap_content” /> <按钮android:layout_width = “ wrap_content” android:layout_height = “” wrap_content“ /> </ RelativeLayout>