我要設計這種特殊的設計XML安卓:在XML Android的佈局設計
logo
EditText X 2
img icon X 2 (email,password)
Button X 2
Lable Text
background
我嘗試這樣做,它不會很好
我要設計這種特殊的設計XML安卓:在XML Android的佈局設計
logo
EditText X 2
img icon X 2 (email,password)
Button X 2
Lable Text
background
我嘗試這樣做,它不會很好
okies所以這裏是你的佈局..
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#fff" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/logo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#fff"
android:gravity="center"
android:padding="10dp" >
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center"
android:background="@drawable/logo" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/logo"
android:layout_centerHorizontal="true"
android:layout_margin="20dp"
android:orientation="vertical" >
<EditText
android:id="@+id/LoginUserName"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:gravity="center"
android:hint="Username"
android:singleLine="true"
android:textColor="#2299de" />
<EditText
android:id="@+id/LoginPassword"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:hint="Password"
android:inputType="textPassword"
android:singleLine="true"
android:textColor="#2299de" />
<Button
android:id="@+id/Login"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:background="#2299de"
android:text="Login"
android:textColor="#fff"
android:textStyle="bold" />
<Button
android:id="@+id/fb"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:background="#ababab"
android:text="Login with facebook"
android:textColor="#fff"
android:textStyle="bold" />
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_marginTop="10dp"
android:background="#000" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal" >
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".49"
android:gravity="center"
android:text="Create an Account"
android:textStyle="bold" />
<View
android:layout_width="2dp"
android:layout_height="fill_parent"
android:layout_margin="10dp"
android:background="#000" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".49"
android:gravity="center"
android:text="Lost Password"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</ScrollView>
謝謝! 如何在示例中設置圖標,電子郵件和密碼的字段? – user3580333
只需設置編輯文本的背景並將paddingleft添加到編輯文本以對齊文本 –
你可以用做垂直LinearLayout。對於底部的兩個按鈕,可以使用水平LinearLayout作爲垂直內部的最後一個子元素。
那你試試?請分享您的佈局 – xgc1986
您可以提出有關您困擾的事情或幫助的問題,但您無法要求論壇爲您開發應用程序。請參閱android開發人員文檔或在網絡上使用示例。 – SacreDeveloper
不錯。你的問題是?和你的代碼不好? –