Android LinearLayout和FrameLayout 登陆布局1

写的比较粗糙,初学android,凑凑合合,马马虎虎的看吧大笑

效果图如下:



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:background="@drawable/home_bg"
    tools:context="com.example.infoandroidnew.app.login">

    <FrameLayout
        android:id="@+id/logo"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dip"
        android:layout_centerHorizontal="true"
        >
        <ImageView
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:id="@+id/imageView"
            android:layout_gravity="center_horizontal"
            android:src="@drawable/home_logo"
            android:scaleType="centerInside" />
    </FrameLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="vertical"
        android:layout_below="@id/logo"
        android:layout_margin="@dimen/activity_horizontal_margin"
        android:background="@color/white">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/activity_horizontal_margin"
            android:layout_marginLeft="@dimen/activity_horizontal_margin"
            android:textSize="25dip"
            android:textColor="@color/holo_blue_dark"
            android:text="@string/login_activity_login"/>

        <EditText
            android:id="@+id/txtUserName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/activity_horizontal_margin"
            android:layout_marginRight="@dimen/activity_horizontal_margin"
            android:layout_marginLeft="@dimen/activity_horizontal_margin"
            android:hint="@string/login_activity_username"
            android:singleLine="true"/>

        <EditText
            android:id="@+id/txtPassword"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/activity_horizontal_margin"
            android:layout_marginRight="@dimen/activity_horizontal_margin"
            android:layout_marginLeft="@dimen/activity_horizontal_margin"
            android:inputType="textPassword"
            android:hint="@string/login_activity_Password"
            android:singleLine="true"/>
        <Button
            android:id="@+id/btnLogin"
            android:layout_gravity="right"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@color/white"
            android:textColor="@color/holo_blue_dark"
            android:layout_marginTop="@dimen/activity_horizontal_margin"
            android:layout_marginRight="@dimen/activity_horizontal_margin"
            android:layout_marginLeft="@dimen/activity_horizontal_margin"
            android:text="@string/login_activity_loginbutton"/>
        </LinearLayout>
</RelativeLayout>


你可能感兴趣的:(Android LinearLayout和FrameLayout 登陆布局1)