导航:首页 > 操作系统 > android漂亮的界面代码

android漂亮的界面代码

发布时间:2023-02-12 07:43:11

‘壹’ 安卓界面要实现这两行三列的布局,该怎样写代码

闲着没事 给你写了

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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:background="#FFF"

android:orientation="horizontal" >


<Button

android:layout_width="0dp"

android:layout_height="match_parent"

android:layout_weight="1"

android:text="BUTTON1" />


<LinearLayout

android:layout_width="0dp"

android:layout_height="match_parent"

android:layout_weight="1.5"

android:orientation="vertical" >


<LinearLayout

android:layout_width="match_parent"

android:layout_height="0dp"

android:layout_weight="1"

android:orientation="horizontal" >


<TextView

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="Text01"

android:textColor="#000" />


<TextView

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="Text01"

android:textColor="#000" />


<TextView

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="Text01"

android:textColor="#000" />

</LinearLayout>


<LinearLayout

android:layout_width="match_parent"

android:layout_height="0dp"

android:layout_weight="1"

android:orientation="horizontal" >


<TextView

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="Text02"

android:textColor="#000" />


<TextView

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="Text02"

android:textColor="#000" />


<TextView

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:text="Text02"

android:textColor="#000" />

</LinearLayout>

</LinearLayout>


<Button

android:layout_width="0dp"

android:layout_height="match_parent"

android:layout_weight="1"

android:text="BUTTON2" />


</LinearLayout>

‘贰’ 创建一个android界面,每行一个组件,依次放置一个EditText组件,一个TextVie

您可以使用Android Studio中的XML布局文件来创建界面。以下是一个示例代码:

该代码创建了一个包含两行的线性布局,每行包含一个线性布局和一个组件。第一行包含一个EditText组件,第二行包含一个TextView组件。

‘叁’ android中如何美化发送短信息的程序界面。

1.跟开发WEB程序一样,先做出UI界面,因为这里我们是要实其功能,界面不作过多的美化。代码如下:
Activity_main.xml
<TextView
android:id="@+id/tv_input_number" //这个是提示用户输入电话号码的TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/please_input_number"
android:textSize="20px" />
<EditText
android:id="@+id/et_number" //这个是输入电话号码的文本框
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_input_number"
android:ems="10"
android:inputType="phone" >
</EditText>
<TextView
android:id="@+id/tv_input_content" //提示输入内容的文本
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/et_number"
android:layout_below="@+id/et_number"
android:text="@string/please_input_content"
android:textSize="20px"
android:textColor="#333333"
/>
<EditText
android:id="@+id/et_content" //这是输入文本内容的文本编辑器
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_input_content"
android:singleLine="true"
android:lines="5"
android:inputType="textMultiLine" />
<Button
android:id="@+id/bt_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/et_content"
android:layout_below="@+id/et_content"
android:layout_marginTop="17dp"
android:height="30px"
android:text="@string/send"
android:textColor="#ff3333"
android:textSize="20px" />
</RelativeLayout>
备注:要注意创建相应该元件的ID号。
2.开始实功能代码.在MainAcivity.java文件中加入以下代码:
MainAcivity.java
public class MainActivity extends ActionBarActivity implements OnClickListener {
private EditText et_number;
private EditText et_content;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et_number = (EditText) findViewById(R.id.et_number);
et_content= (EditText) findViewById(R.id.et_content);
Button bt_send=(Button) findViewById(R.id.bt_send);
bt_send.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.bt_send:
String number=et_number.getText().toString().trim();
String content=et_content.getText().toString().trim();
if(TextUtils.isEmpty(number)||TextUtils.isEmpty(content)){
Toast.makeText(this, "手机号和内容不能为空", Toast.LENGTH_LONG).show();
return;
}else{
SmsManager smsManger=SmsManager.getDefault();
ArrayList<String> contents=smsManger.divideMessage(content);
for(String str:contents){
smsManger.sendTextMessage(number, null, str, null, null);
}
}
break;
default:
break;
} }}

‘肆’ 怎么将android界面做的绚丽一点

android 动画,界面切换,按钮点击效果,触摸效果侵入式状态栏,列表的读取和刷新,等等都可以让界面变的
绚丽点

‘伍’ 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、实现效果如下:

‘陆’ 只会写代码的屌丝怎么做出界面优美Android界面

参考Material设计规范,对于初学者来说,界面越简洁,颜色越少越少,越容易作出漂亮的界面,同时可以增加阴影效果。界面类似卡片的组合。

Material Design是由 Google 推出的设计语言,它更适用于 UI 视觉界面的配色,能起到更统一、更舒服的作用。MD 所展示的颜色较鲜艳,所以在设备上展示出来也是很有识别性。有时候大家看到某个界面颜色很突出,干净且简约,那一定是按照 MD 的颜色来设计的。

下面是MD色板

‘柒’ android studio怎么编写一个简易的qq登陆界面源代码

你说的这个软件我本人没用过 不过我用制作QQ登陆框是用另外的软件制作的 HA-eXeScope rashacker 两款软件各自功用不同 但大体使用手法也不太一样的 我是两款软件合起来使用 不知道我说的合不合你胃口 如果你要下的话可以在 天空 和非凡软件园里找到 教程可以到网上去找 那里都有的 做出的效果都非常漂亮 祝你好运

‘捌’ android 怎么写一个类似menu的界面

其实直接用popupwindow更方便,现在开发中一般是用popupwindow充入自定义view的方式来显示类似menu界面效果的。相对于用windowmanager.addview() 方法,popupwindow集成了一系列的显示隐藏处理,更方便实用。关于popupwindow的用法网上实例很多。

‘玖’ 求大神告知Android微信朋友圈界面代码

<?xmlversion="1.0"encoding="utf-8"?>
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="cn.tomcat7..MainActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:layout_width="64dip"
android:layout_height="64dip"
android:src="@mipmap/ic_launcher"/>

<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="赤壁赋"
android:textColor="#000000"
android:textSize="16dip"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="壬戌之秋,七月既望,苏子与客泛舟游于赤壁之下。清风徐来,水波不兴。举酒属客,诵明月之诗,歌窈窕之章。少焉,月出于东山之上,徘徊于斗牛之间。白露横江,水光接天。纵一苇之所如,凌万顷之茫然。浩浩乎如冯虚御风,而不知其所止;飘飘乎如遗世独立,羽化而登仙。"/>
</LinearLayout>
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="#f1f1f1"/>

</LinearLayout>

‘拾’ 有什么网站提供android好看的ui界面及源码

android学习手册,里面有源码。android学习手册包含9个章节,108个例子,源码文档随便看,例子都是可交互,可运行,源码采用android studio目录结构,高亮显示代码,文档都采用文档结构图显示,可以快速定位。360手机助手中下载,图标上有贝壳

阅读全文

与android漂亮的界面代码相关的资料

热点内容
穿越火线更新怎么开新服务器 浏览:315
腹部超声pdf 浏览:920
解压缩全能王能解压7z文件吗 浏览:248
python目录比较 浏览:645
公司程序员戴假发 浏览:345
oracle查看数据库状态命令 浏览:840
查汽车app叫什么 浏览:747
经济学英文pdf下载 浏览:798
python列表顺序 浏览:698
云南边缘计算服务器云服务器 浏览:105
小公司如何选择服务器 浏览:791
android指纹识别驱动 浏览:447
荣耀手机的系统有方舟编译器吗 浏览:629
单片机应用的论文 浏览:474
什么app可以查网购的真伪 浏览:444
培训班的程序员怎么样找工作 浏览:813
codeblocks编译器位数 浏览:447
bios加密怎么设置 浏览:350
台电u盘加密大师损坏 浏览:850
secure网站加密 浏览:124