补充说明一下,经常出现UI不显示自己的设计结果的情况。通过查阅文档,发现在style.xml中的parent中添加Base.即可很好的解决问题。
###1.图片切换
####应用的控件:
- EditView
- TextView
- ImageView
- Button
####将图片引入
这个步骤非常简单,只需要把所需图片复制到drawable文件夹中,如图
####设计布局:
很简单我们只需要它顺次排列,因此只需要用最简单的线性布局,因此在.xml文件中改写:
<LinearLayout 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"
android:orientation="vertical"//垂直线性排列
tools:context=".MainActivity">
EditView部分
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
####TextView部分
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/easy_te