TEL:400-8793-956
当前位置:程序、服务器

无法将TextView更改为Button

提问者: 近期获赞: 浏览人数: 发布时间:2021-02-28 09:18:08

 问:看完视频课程并进行了快速尝试后.....我无法将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>  
上一篇: 添加时间增量-不确定问题出在哪里
下一篇: 我建立了一个网站..但无法在移动视图中使div / iframe居中..有点卡住了