学会使用findComponentById
1.首先在ability_main. xml中建立页面展示,创建Button按钮,设置其id、height、width、text、size、背景颜色。
给id设置唯一的名字,match_content可以将height和width中的文字和高宽一样大,text中写上展示的默认文字,
text_size设置文字大小,background_element设置背景颜色 ,代码如图
学会使用findComponentById
1.首先在ability_main. xml中建立页面展示,创建Button按钮,设置其id、height、width、text、size、背景颜色。
给id设置唯一的名字,match_content可以将height和width中的文字和高宽一样大,text中写上展示的默认文字,
text_size设置文字大小,background_element设置背景颜色 ,代码如图