android:登陆界面

一个简单的登陆界面

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Smart Home"
        android:textColor="#2faebd"
        android:textSize="30dp"
        android:layout_marginTop="80dp"
        android:layout_marginLeft="100dp"/>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/icon_zhanghao"
            android:layout_marginLeft="50dp"
            android:layout_marginTop="40dp"
            />
        <AutoCompleteTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="45dp"
            android:layout_marginLeft="20dp"
            android:hint="请输入手机号码"
            />
    </LinearLayout>
    <LinearLayout
        android:layout_width="300dp"
        android:layout_height="1px"
        android:background="#c0c0c0"
        android:layout_marginLeft="50dp"
        android:layout_marginTop="5dp">
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
    android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon_mima"
android:layout_marginLeft="50dp"
android:layout_marginTop="10dp"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginLeft="20dp"
android:inputType="textPassword"
android:hint="请输入密码"
    />

    </LinearLayout>
<LinearLayout
android:layout_width="300dp"
android:layout_height="1px"
android:background="#c0c0c0"
android:layout_marginLeft="50dp"
android:layout_marginTop="5dp">
</LinearLayout>

<Button
android:layout_width="300dp"
android:layout_height="100px"
android:textColor="#ffffff"
android:text="登陆"
android:layout_marginLeft="45dp"
android:layout_marginTop="30dp"
android:background="@drawable/shape"
android:textSize="40px"
android:onClick="skip" />

    </LinearLayout>

这里写图片描述
跳转界面的代码

package com.example.yourdad;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    public void skip(View view){
        Intent intent = new Intent();
        intent.setClass(MainActivity.this,Main2Activity.class);
        startActivity(intent);

注意的是要在设计界面button加上skip,第一天没有成功就是这个原因

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值