Android网络编程-登陆界面的实现(二)
2015-04-09 20:01
155 查看
二.客户端Activity-登陆界面的实现
<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" tools:context=".MainActivity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="用户名:" android:id="@+id/textView" android:textSize="25sp" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_marginTop="87dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="密 码:" android:textSize="25sp" android:id="@+id/textView2" android:layout_below="@+id/textView" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_marginTop="71dp" /> <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:inputType="textPersonName" android:text="Name" android:ems="10" android:id="@+id/editText" android:layout_alignTop="@+id/textView" android:layout_alignLeft="@+id/button" android:layout_alignStart="@+id/button" /> <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:inputType="textPassword" android:ems="10" android:id="@+id/editText2" android:layout_alignBottom="@+id/textView2" android:layout_alignLeft="@+id/editText" android:layout_alignStart="@+id/editText" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="登陆" android:id="@+id/button" android:layout_marginTop="112dp" android:layout_below="@+id/editText2" android:layout_centerHorizontal="true" /> </RelativeLayout>
package com.example.justyu.login_demo; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; public class MainActivity extends ActionBarActivity implements View.OnClickListener{ private EditText loginName,loginPassword; private Button loginButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); loginName=(EditText)this.findViewById(R.id.editText); loginPassword=(EditText)this.findViewById(R.id.editText2); loginButton=(Button)this.findViewById(R.id.button); loginButton.setOnClickListener(this); } //点击登陆按钮 后进行的操作 @Override public void onClick(View v) { } }
相关文章推荐
- Android网络编程之一个Android下菜单系统模块的实现(主操作界面)
- Android编程获取网络连接状态(3G/Wifi)及调用网络配置界面
- Android实现一个记住密码的登陆界面
- Android网络编程之一个Android下菜单系统模块的实现(客户端—开桌功能(上部))
- Android网络编程之一个Android下菜单系统模块的实现(服务器端—结算功能(中部))
- Android编程获取网络连接状态(3G/Wifi)及调用网络配置界面
- Android网络编程之一个Android下菜单系统模块的实现(客户端—添单功能(上部))
- Android网络编程之一个Android下菜单系统模块的实现(服务器端—开桌功能))
- Android网络编程之一个Android下菜单系统模块的实现(客户端—添单功能(中部))
- Android网络编程之一个Android登录系统模块的实现(服务器端)
- Android编程获取网络连接状态(3G/Wifi)及调用网络配置界面
- android欢迎界面的编程实现[手相评分-软件实例]
- 实现一个记住密码的Android登陆界面
- Android网络编程之一个Android下菜单系统模块的实现(客户端—开桌功能(下部))
- Android编程获取网络连接状态(3G/Wifi)及调用网络配置界面
- Android实现一个记住密码的登陆界面
- Android网络编程之通过Get方法实现
- Android编程获取网络连接状态(3G/Wifi)及调用网络配置界面
- Android编程获取网络连接状态(3G/Wifi)及调用网络配置界面
- Android学习笔记(19)————实现一个记住密码的Android登陆界面