这段时间才开始进入了安卓的学习,是一个实实在在的菜鸟,今天,运用才学到的知识,做了一个简单的登录界面,算是对这段时间学习的总结吧。
首先,就是打开android studio这个应用。。。。。。
新建一个项目,然后在res这个文件下面新建一个layout文件(这个就是布局文件夹),在这个文件夹里创建一个empty activity(一定要选择这个活动是主活动,不然应用无法运行)
加入以下代码
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:stretchColumns="0,3">
android:text="账 号:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:id="@+id/account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24px"
android:minWidth="220px"/>
android:text="密 码:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:id="@+id/pwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="220px"
android:textSize="24px"
android:inputType="textPassword"/>
android:id="@+id/login"
android:text="登录"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:id="@+id/quit"
android:text="退出"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
就可以了