刚开始学习Android真的是头很大,需要学习和理解的东西太多,还好网上可以四处搜索加强自己的理解和学习,多的不说上图片上代码。
实际效果是这样的:
布局文件:
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView