当前位置:首页 » 安卓系统 » android登陆布局

android登陆布局

发布时间: 2022-11-22 02:42:34

A. android 界面布局实现

1、最外面用线性布局,属性为垂直,margin TOP属性设置为10px,在这个布局包括了下面的2、3、4、5、6几个布局
2、日常选项为TextView,
3、时间用线性布局属性为水平,margin right属性设置为10px,同时添加背景图片属性,里面在放两个TextView分别是时间和2011-10-06 11:04,包含在时间的线性布局中
4、账户用线性布局属性为水平,margin right属性设置为10px,同时添加背景图片属性,里面在放两个TextView分别是账户和现金,包含在时间的账户的线性布局中
5、商家地点用线性布局属性为水平,margin right属性设置为10px,同时添加背景图片属性,里面在放两个TextView分别是商家地点和未指定,包含在商家/地点的线性布局中
6、备注用线性布局属性为水平,margin right属性设置为10px,同时添加背景图片属性,里面放一个TextView是备注
这样就可以做出来了
还不明白的话在给我留言吧~我把大概的代码写给你看~

B. android登陆界面用什么布局好

布局无所谓,相对布局,线性布局都行,还可以自定义布局.

C. android登陆界面用哪个布局好

整理思路:
1、控件:文字TextView 和 右箭头ImageView
2、因为考虑到点击效果,设计为:最外层为全圆角,内层有四种情况,分别为上圆角、无圆角、下圆角和全圆角。
3、内层样式效果:需要初始样式、和点击样式
4、需要知识:结合style、shake、selector组合样式
布局:
布局文件
样式:
layout样式
控件样式
点击样式和默认样式

其中举例上圆角的背景设置为:
top_layout_selector.xml
top_select.xml

D. 如何设计android的登录界面

在网上在到一个登录界面感觉挺不错的,给大家分享一下~先看效果图:

这个Demo除了按钮、小猫和Logo是图片素材之外,其余的UI都是通过代码实现的。

?

一、背景

背景蓝色渐变,是通过一个xml文件来设置的。代码如下:

background_login.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:andro>
<gradient
android:startColor="#FFACDAE5"
android:endColor="#FF72CAE1"
android:angle="45"
/>
</shape>


startColor是渐变开始的颜色值,endColor是渐变结束的颜色值,angle是渐变的角度。其中#FFACDAE5中,FF是Alpha值,AC是RGB的R值,DA是RGB的G值,E5是RGB的B值,每个值在00~FF取值,即透明度、红、绿、蓝有0~255的分值,像要设置具体的颜色,可以在PS上的取色器上查看设置。

?

?

二、圆角白框

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

background_login_div.xml

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:andro>
<solid android:color="#55FFFFFF" />
<!-- 设置圆角
注意: bottomRightRadius是左下角而不是右下角 bottomLeftRadius右下角-->
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp"
android:bottomRightRadius="10dp" android:bottomLeftRadius="10dp"/>
</shape>

?

三、界面的布局

界面的布局挺简单的,就直接贴代码啦~

login.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:andro
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:
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:
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp"
android:text="@string/login_label_username"
/>
<EditText
android:
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:
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"
/>
<EditText
android:
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:
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:
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:
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>

E. Android studio相对布局怎么设计一个登陆界面

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#55ffff">

<TextView
android:id="@+id/tv_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:padding="10dp"
android:background="#ffffff"
android:hint="密码"
android:textSize="15sp"
android:textColor="#000000"
android:layout_centerInParent="true"/>


<TextView
android:id="@+id/tv_user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#ffffff"
android:padding="10dp"
android:hint="用户名"
android:textSize="15sp"
android:layout_marginBottom="15dp"
android:textColor="#000000"
android:layout_above="@+id/tv_password"/>

<TextView
android:id="@+id/tv_forget_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_password"
android:layout_alignLeft="@+id/tv_password"
android:paddingTop="10dp"
android:text="忘记密码>"
android:textSize="14sp"
android:textColor="#ff0000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_password"
android:layout_alignRight="@+id/tv_password"
android:paddingTop="10dp"
android:text="注册>"
android:textSize="14sp"
android:textColor="#ff0000" />

<Button
android:id="@+id/but_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginTop="20dp"
android:background="#4169E1"
android:text="登录"
android:textSize="18sp"
android:textColor="#ffffff"
android:layout_below="@+id/tv_forget_password"/>

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/ic_launcher"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:layout_above="@+id/tv_user"/>
</RelativeLayout>

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

首先程序进入SplashActivity,就是启动页面。
xml布局文件就是一个全屏的图片,要注意的是设置android:scaleType ="matrix"这个属性。不然不会全屏。
过1秒之后转入登陆页面,从图片我们可以看出,腾讯的UI做的还是相当美观漂亮的,既简洁又不失美观。先分析一下这个登录界面,从整体可以看出,根布局的
背景色是蓝色的,而那个QQ Android其实是一个图片背景色和根布局的背景色一样,这样就不会有视觉偏差。

G. App登录界面----布局篇

       我自学了3个月的Android基础,居然一个App都做不出来。在我之前学的同时居然忘记了之前学的内容。所以我现在重新开始复习,这篇文章将是我复习的开始也是基础的稳固,同时也是将来记不得了可以自我回顾的笔记。首先是从App登录开始。

       首先第一是布局,登录界面布局那就要用到控件,登录界面所需控件如下:

1.姓名     输入框   密码 输入框:就要有Textview文本控件 X 2, Editview输入文本框控件 X 2

2.立即注册  忘记密码 登录 :就要有Button控件 X 3

既然要布局就要有布局控件:可以用RelativeLayout相对布局,LinearLayout线性布局,TableLayout表格布局,FrameLayout帧布局,AbsoluteLayout绝对布局。我要选用就就是前两个布局:RelativeLayout相对布局或者LinearLayout线性布局。

这就是我最终预想所要达到的效果:

首先打开布局文件:展开app--->res--->layout--->activity_main.xml

切换到设计模式Design:

然后从调色板Palette就是控件库拖拽出所需控件:

2个Textview,2个Editview ,3个Button.一开始布局控件就是相对布局控件,RelativeLayout相对布局控件允许通过指定显示对象相对于父容器或其他兄弟控件的相对位置结合margin,padding来进行布局。

然后我们再切换回文本模式Text:

<TextView

android:text="TextView"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

/>这就组成了一个控件。

再来解释解释RelativeLayout相对布局控件是啥意思:

上图所表现的意思就是RelativeLayout相对布局控件的特点:TextView文本控件基于父容器(RelativeLayout相对布局控件)之下,再看图:

它会自动添加默认属性:android:text="文本控件"//这是文本属性可以输入文字

android:textSize="50dp"//这是文本大小属性是控制text属性的大小

android:layout_width="wrap_content"//这是宽,选择的自适应屏幕

android:layout_height="wrap_content"这是高。

android:layout_marginTop="253dp"// 重点就在这里了:在RelativeLayout相对布局下拖出的控件会有这条属性,意思是TextView相距父容器253dp的距离

android:id="@+id/textView"

android:layout_alignParentTop="true"

android:layout_centerHorizontal="true"

好了我们继续:我写的这个布局呢?只用了两个EditView控件和三个Button控件。先说EditView控件。

拖拽出来改好了各种属性但是和我的不一样,哪里不一样?有边框,边框还是圆角。怎么弄的?这是改变了它的样式。首先目录找到drawable文件按下Alt+lns键,点击Drawable resource file

那就会弹出下面这个框框好创建资源文件,File name:这是资源文件的名字,Root element:这是需要创建什么类型的资源文件。

假如没有出现这个对话框而是另外的对话框就请更换模式

将Android 目录模式切换成Project目录模式

找到drawable文件重复上面操作就会出现

名字就自己取吧,类型选择shape文件

这就是我为EditView设置的资源文件,那么怎么加载它呢?

用背景background属性来加载:@drawable/border用@选择文件位置加载就成功了。

文本框就做好了。噢!!!等等还有个属性android:hint="登录"还没介绍,这是提示语:比如请输入用户名,请输入密码,这样的提示语,只起到提示作用。范例:android:hint="请输入用户名"

好吧依次类推,Button按钮也是这样。我们先来看忘记密码,立即注册两控件这两我没这样加载资源文件,我只用了3条属性,

android:background="@null"//这条意思是背景设置路径为空,作用是消除边框。

android:shadowColor="#338AFF"//改变按钮背景颜色,让它看起来和相对布局背景融为一体。

android:textColor="#0066CC"//改变文字颜色

怎么样是不是和QQ登录界面的差不多

那再来看立即登录按钮,这个按钮我用了三个资源文件,为了让按钮按下抬起有一个变色效果,能够反馈用户视觉:您已按下按钮。

首先看按下的资源文件:

这是按下的模样,radius是设置圆角,然后是按下后的颜色。

再来看抬起:

这是抬起时候的样子,圆角按下抬起都要设置一样,不然按下是一个样,抬起又是另一个样子,然后是抬起的颜色。

这是两个资源文件,如何让按钮呈现出按下抬起的不同效果呢?

就需要另一个资源文件来操控:selector资源文件

由他来控制这两个资源文件:

<item/>这是资源文件的标签,包括shape资源文件的:<corners/><solid/>都是标签

标签<item/>里面

android:drawable="@drawable/clickroundedcolor"//是加载按下资源文件,

android:state_pressed="true"//true就是对,就是一个判断作用,判断是否按下,按下就加载按下的资源文件

然后再一个子标签<item/>

<item android:drawable="@drawable/roundedcolor"/>也就是说当上面pressed不为true的时候执行下面这个标签加载抬起状态的效果。

这就做成了按下深蓝抬起浅蓝的颜色效果。那今天就到这里,复习到了什么Editview Button控件的使用然后在原来的基础上学到了EditView 和Button控件的UI设计一些细节效果。

还熟悉了Android studio。之前用Eclipse学习的Android,现在改用AS还特别不习惯,希望复习后我会熟练Android studio。恩,还有看到忘记密码,立即注册两个按钮是不是还会联想到还有两个布局。没错,忘记密码和立即注册这两个布局文件,就不用记录了,相信会了登录主界面布局,其他两个不在话下。

H. android怎么做动态的登陆界面

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

UI实现的代码如下:

1、背景设置图片:

background_login.xml

<?xmlversion="1.0"encoding="utf-8"?>

<shapexmlns:android="http://schemas.android.com/apk/res/android">

<gradient

android:startColor="#FFACDAE5"

android:endColor="#FF72CAE1"

android:angle="45"

/>

</shape>

2、圆角白框

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

background_login_div.xml

<?xmlversion="1.0"encoding="UTF-8"?>

<shapexmlns:android="http://schemas.android.com/apk/res/android">

<solidandroid:color="#55FFFFFF"/>

<!--设置圆角

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

<cornersandroid:topLeftRadius="10dp"android:topRightRadius="10dp"

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

</shape>


3、界面布局:

login.xml

<?xmlversion="1.0"encoding="utf-8"?>

<LinearLayout

xmlns:android="http://schemas.android.com/apk/res/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">

<TextViewandroid: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"/>

<ImageViewandroid: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"/>

<ImageViewandroid: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,去掉标题栏。

packagecom.mytwitter.acitivity;

importandroid.app.Activity;

importandroid.os.Bundle;

importandroid.view.Window;

{

@Override

publicvoidonCreate(BundlesavedInstanceState){

super.onCreate(savedInstanceState);

requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.login);

}

}

5、实现效果如下:

I. android登陆界面该怎么写啊

android new activity的时候就有示例可以选择,google有现成的登录界面布局可以选择。

J. 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 创建虚拟机。

热点内容
电脑如何局域网共享文件夹 发布:2024-05-19 01:25:01 浏览:67
手机存储越大性能越好吗 发布:2024-05-19 01:14:28 浏览:176
我的世界hyp服务器怎么玩 发布:2024-05-19 00:51:25 浏览:801
手机如何解压百度云文件 发布:2024-05-19 00:32:24 浏览:905
centos使用python 发布:2024-05-18 23:39:48 浏览:868
幻影天龙脚本 发布:2024-05-18 23:38:17 浏览:712
编程的py 发布:2024-05-18 23:36:22 浏览:75
安卓系统怎么改序列号 发布:2024-05-18 23:28:16 浏览:783
c语言中实数 发布:2024-05-18 23:21:03 浏览:895
服务器搭建题目 发布:2024-05-18 23:01:29 浏览:28