android:启动界面设计

界面1

界面1布局代码


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:background="@drawable/welbk">
LinearLayout>

java代码

package com.android.test.login;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

/**
 * Created by Mario on 2017/2/27.
 */
public class Welcome_Activity extends Activity {
    private final int SPLASH_DISPLAY_LENGHT = 6000;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        new android.os.Handler().postDelayed(new Runnable() {
            public void run() {
                Intent mainIntent = new Intent(Welcome_Activity.this,Date.class);
                Welcome_Activity.this.startActivity(mainIntent);
                Welcome_Activity.this.finish();
            }
        }, SPLASH_DISPLAY_LENGHT);
    }
}

界面2
android:启动界面设计_第1张图片
界面2布局代码


<LinearLayout android:orientation="vertical" android:id="@+id/loginRoot"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout android:orientation="vertical" android:id="@+id/LinearLayout01"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:layout_weight="1.0"
        android:background="@drawable/default_bg">
        <RelativeLayout android:id="@+id/RelativeLayout02"
            android:background="@drawable/login_back" android:paddingTop="21.0px"
            android:paddingBottom="10.0px" android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:layout_marginLeft="15.0px"
            android:layout_marginTop="62.0px" android:layout_marginRight="15.0px">
            <ImageView android:id="@+id/faceImg" android:background="@drawable/login_head"
                android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <EditText android:id="@+id/login_edit_account"
                android:background="@drawable/qq_edit_login" android:paddingLeft="45.0sp"
                android:saveEnabled="true" android:layout_width="fill_parent"
                android:layout_height="wrap_content" android:layout_marginLeft="5.0dip"
                android:layout_marginTop="5.0dip" android:layout_marginRight="5.0dip"
                android:layout_marginBottom="5.0px" android:hint="@string/strInputAccHint"
                android:maxLength="10" android:layout_toRightOf="@+id/faceImg"
                android:layout_alignParentTop="true" android:inputType="number" />
            <TextView android:textSize="16.0dip" android:textColor="#ff3f3f3f"
                android:gravity="center_vertical" android:id="@+id/TextView01"
                android:paddingLeft="7.0sp" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:layout_marginRight="15.0sp"
                android:text="@string/strAccInputLabel" android:layout_alignLeft="@+id/login_edit_account"
                android:layout_alignTop="@+id/login_edit_account"
                android:layout_alignBottom="@+id/login_edit_account" />
            <ImageButton android:id="@+id/ImageButton02"
                android:background="@drawable/more_select" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:layout_marginRight="1.0dip"
                android:layout_alignTop="@+id/login_edit_account"
                android:layout_alignRight="@+id/login_edit_account"
                android:layout_alignBottom="@+id/login_edit_account" />
            <EditText android:id="@+id/login_edit_pwd"
                android:background="@drawable/qq_edit_login" android:paddingLeft="45.0sp"
                android:saveEnabled="true" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:layout_marginRight="1.0dip"
                android:maxLength="16" android:layout_below="@+id/login_edit_account"
                android:layout_alignLeft="@+id/login_edit_account"
                android:layout_alignRight="@+id/login_edit_account"
                android:inputType="textPassword" />
            <TextView android:textSize="16.0dip" android:textColor="#ff3f3f3f"
                android:gravity="center_vertical" android:id="@+id/TextView02"
                android:paddingLeft="7.0sp" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:text="@string/strPswInputLabel"
                android:layout_alignTop="@+id/login_edit_pwd"
                android:layout_alignRight="@+id/TextView01"
                android:layout_alignBottom="@+id/login_edit_pwd" />
            <CheckBox android:textSize="16.0sp" android:textColor="#ff222222"
                android:id="@+id/login_cb_savepwd" android:paddingLeft="25.0px"
                android:layout_width="wrap_content" android:layout_height="wrap_content"
                android:checked="true" android:button="@drawable/qq_btn_check"
                android:text="@string/opt_remember" android:layout_alignBaseline="@+id/login_btn_login" />
            <Button android:id="@+id/login_btn_login" android:layout_width="130.0px"
                android:layout_height="42.0px" android:layout_marginTop="7.0px"
                android:layout_marginRight="12.0dip" android:text="@string/login"
                android:layout_below="@+id/TextView02"
                android:layout_alignParentRight="true" />
        RelativeLayout>
        <TableLayout android:id="@+id/TableLayout01"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:layout_marginLeft="20.0px" android:layout_marginRight="20.0px"
            android:stretchColumns="1">
            <TableRow>
                <CheckBox android:textColor="#7fffffff" android:id="@+id/login_cb_visible"
                    android:layout_width="wrap_content" android:layout_height="wrap_content"
                    android:text="@string/opt_hideLogin" style="@style/MyCheckBox" />
                <CheckBox android:textColor="#7fffffff"
                    android:layout_gravity="right" android:id="@+id/login_cb_openvibra"
                    android:layout_width="wrap_content" android:layout_height="wrap_content"
                    android:text="@string/opt_openVibra" style="@style/MyCheckBox" />
            TableRow>
            <TableRow>
                <CheckBox android:textColor="#7fffffff" android:id="@+id/login_cb_receivegroupmsg"
                    android:layout_width="wrap_content" android:layout_height="wrap_content"
                    android:text="@string/opt_acceptGroupMsg" style="@style/MyCheckBox" />
                <CheckBox android:textColor="#7fffffff"
                    android:layout_gravity="right" android:id="@+id/login_cb_quite"
                    android:layout_width="wrap_content" android:layout_height="wrap_content"
                    android:text="@string/opt_silent" style="@style/MyCheckBox" />
            TableRow>
        TableLayout>
    LinearLayout>
    <RelativeLayout android:id="@+id/RelativeLayout01"
        android:background="@drawable/bottom" android:layout_width="fill_parent"
        android:layout_height="44.0dip">
        <ImageButton android:id="@+id/login_option"
            android:background="@drawable/option" android:clickable="true"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_marginLeft="13.0dip" android:layout_marginTop="2.0dip"
            android:layout_centerVertical="true" />
    RelativeLayout>
LinearLayout>

java代码

package com.android.test.login;

import android.app.Activity;
import android.os.Bundle;

public class Date extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.loginpage);
    }
}

manifest文件


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.android.test.login"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Welcome_Activity"
                  android:label="@string/app_name"
                  android:theme = "@android:style/Theme.NoTitleBar.Fullscreen"
                  android:noHistory="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            intent-filter>
        activity>
    <activity android:name=".Date" >
    activity>
    application>
manifest> 

仿qq代码摘自别人的微博,连接找不到了sorry!

你可能感兴趣的:(android,界面,布局)