这是一个个人学习记录
这几天忙着做一个Android项目,我被分配到了写一个类似于微信个人资料的界面任务。其他的都还好,就是头像和呢称那一块无法用简单的方法使用Button做出来,最后被其他人说了一下才绕过只有Button才能被点击这个弯,使用了线性布局来完成了界面代码。还是被Java影响太深,线性布局只要有id就可以在Java代码证设置监听器来令其出现点击效果。
activity_main.xml代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#C0C0C0"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginBottom="20dp"
android:background="#FFFFFF"
android:orientation="horizontal" >
<ImageView
android:id="@+id/touxiang"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"