Android视图是有xml语法来编写的,其中一些语法定义是很奇葩,但也只能去适应,没有别的办法。比如Android里定义ID名是这样的:android:id="@+id/btn_search"。我每次看这个@+id都感觉很奇葩,哈哈。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffffff">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/title_background"
android:paddingLeft="5dip"
android:paddingRight="5dip"
android:paddingTop="5dip"
android:paddingBottom="5dip"
android:gravity="center_vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2">
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="KibaXamarin_Android"
android:textColor="#ffffffff" />
<ImageView
android:src="@drawable/ic_arrow_down"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffffff" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5">
<ImageButton
android:src="@drawable/toolbar_upload_photo_normal"
android:layout_gravity="right|center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_weight" />
</FrameLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:background="@drawable/search_bar_background"
android:padding="6.0dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button
android:textAppearance="?android:textAppearanceMedium"
android:gravity="left|center"
android:id="@+id/btn_search"
android:layout_width="0.0dip"
android:layout_height="wrap_content"
android:hint="\u0020Click Me"
android:drawableLeft="@drawabl