网站建设资讯

NEWS

网站建设资讯

android登录界面设计,Android登录界面设计代码

Android studio怎么连接本地数据库设计登录界面?

我们项目的前提是你已经将基本的运行环境及sdk都已经安装好了,读者可自行百度环境配置相关内容,本文不再赘述。右键点击new--Module,Module相当于新建了一个项目。

成都创新互联是一家专业提供龙川企业网站建设,专注与成都网站设计、成都网站建设、html5、小程序制作等业务。10年已为龙川众多企业、政府机构等服务。创新互联专业网站设计公司优惠进行中。

选择Android Application,点击next

将My Module 和app改成自己项目相应的名字,同时选择支持的Android版本

这一步我们选择Blank Activity,自己手动编写登录界面,而不依赖系统内置的Login Activity,一直点击next,最后点击finish就完成了项目的创建

在project下我们可以看到出现了我们刚才创建的login项目

展开res/layout,点击打开activity_main.xml文件,在这个文件里我们将完成登录界面的编写

这是初始的主界面,还没有经过我们编写的界面,Android Studio有一个很强大的预览功能,相当给力,将activity_main.xml的代码替换成如下代码:

TableLayout xmlns:android=""

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:gravity="center_vertical"

android:stretchColumns="0,3"

TableRow

TextView /

TextView

android:text="账 号:"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:textSize="24px"

/

EditText

Android如何实现类似于QQ登录的界面,求大神!

首先程序进入SplashActivity,就是启动页面。

xml布局文件就是一个全屏的图片,要注意的是设置android:scaleType ="matrix"这个属性。不然不会全屏。

过1秒之后转入登陆页面,从图片我们可以看出,腾讯的UI做的还是相当美观漂亮的,既简洁又不失美观。先分析一下这个登录界面,从整体可以看出,根布局的

背景色是蓝色的,而那个QQ Android其实是一个图片背景色和根布局的背景色一样,这样就不会有视觉偏差。

android怎么做动态的登陆界面

设计android的登录界面的方法:

UI实现的代码如下:

1、背景设置图片:

background_login.xml

?xml version="1.0" encoding="utf-8"?

shape xmlns:android=""  

gradient

android:startColor="#FFACDAE5"

android:endColor="#FF72CAE1"

android:angle="45"

/

/shape

2、圆角白框

效果图上面的并不是白框,其实框是白色的,只是设置了透明值,也是靠一个xml文件实现的。

background_login_div.xml

?xml version="1.0" encoding="UTF-8"?

shape xmlns:android=""  

solid android:color="#55FFFFFF" /

!-- 设置圆角

注意: bottomRightRadius是左下角而不是右下角  bottomLeftRadius右下角--

corners android:topLeftRadius="10dp" android:topRightRadius="10dp"

android:bottomRightRadius="10dp" android:bottomLeftRadius="10dp"/

/shape

3、界面布局:

login.xml

?xml version="1.0" encoding="utf-8"?

LinearLayout

xmlns:android=""  

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:background="@drawable/background_login"

!-- padding 内边距   layout_margin 外边距

android:layout_alignParentTop 布局的位置是否处于顶部 --

RelativeLayout

android:id="@+id/login_div"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:padding="15dip"

android:layout_margin="15dip"

android:background="@drawable/background_login_div_bg" 

!-- 账号 --

TextView

android:id="@+id/login_user_input"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignParentTop="true"

android:layout_marginTop="5dp"

android:text="@string/login_label_username"

style="@style/normalText"/

EditText

android:id="@+id/username_edit"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:hint="@string/login_username_hint"

android:layout_below="@id/login_user_input"

android:singleLine="true"

android:inputType="text"/

!-- 密码 text --

TextView

android:id="@+id/login_password_input"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/username_edit"

android:layout_marginTop="3dp"

android:text="@string/login_label_password"

style="@style/normalText"/

EditText

android:id="@+id/password_edit"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_below="@id/login_password_input"

android:password="true"

android:singleLine="true"

android:inputType="textPassword" /

!-- 登录button --

Button

android:id="@+id/signin_button"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/password_edit"

android:layout_alignRight="@id/password_edit"

android:text="@string/login_label_signin"

android:background="@drawable/blue_button" /

/RelativeLayout

RelativeLayout

android:layout_width="fill_parent"

android:layout_height="wrap_content" 

TextView  android:id="@+id/register_link"

android:text="@string/login_register_link"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginLeft="15dp"

android:textColor="#888"

android:textColorLink="#FF0066CC" /

ImageView android:id="@+id/miniTwitter_logo"

android:src="@drawable/cat"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignParentRight="true"

android:layout_alignParentBottom="true"

android:layout_marginRight="25dp"

android:layout_marginLeft="10dp"

android:layout_marginBottom="25dp" /

ImageView android:src="@drawable/logo"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_toLeftOf="@id/miniTwitter_logo"

android:layout_alignBottom="@id/miniTwitter_logo"

android:paddingBottom="8dp"/

/RelativeLayout

/LinearLayout

4、java源代码,Java源文件比较简单,只是实例化Activity,去掉标题栏。

package com.mytwitter.acitivity;

import android.app.Activity;

import android.os.Bundle;

import android.view.Window;

public class LoginActivity extends Activity {

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.login);

}

}

5、实现效果如下:

android studio做酷狗登录界面

android studio做酷狗登录界面如下

使用Android Studio 编写的第一个demo,使用布局文件—xml实现用户登录界面

注:所建工程均为Android 6.0 所以只要是Android 6.0(包括6.0)以上的真机,模拟机都可以使用

Step1:Android Studio 开发环境的搭建:

1.安装JDK (1.8);

2.安装Android studio (3.3.1) 包含 gradle、sdk manage 、avd manage ;

3.使用sdk manage 下载安装 sdk;

4.使用avd manages 创建虚拟机。


当前题目:android登录界面设计,Android登录界面设计代码
文章转载:http://cdweb.net/article/dsecgis.html