android布局自适应小示例(用户反馈界面)
要求:
1、整个界面刚好填满屏幕,不需要滚动
2、输入反馈内容的EditText控件高度能够自适应
3、提交按钮位于屏幕最下方
核心布局文件如下:
- <?xml version="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">
- <TextView
- android:text="用户反馈"
- android:layout_width="fill_parent"
- android:layout_height="40dip"
- android:background="#363433"
- android:textColor="#FFFFFF"
- android:gravity="center"
- android:textSize="20sp"/>
- <LinearLayout android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:paddingLeft="10dp"
- android:paddingRight="10dp">
- <TextView android:id="@+id/feedback_title"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:textSize="19dp"
- android:textColor="#706F6D"
- android:layout_marginTop="10dp"
- android:layout_marginBottom="10dp"
- android:text="欢迎您提出宝贵的意见和建议,您的建议对我们改善服务非常有帮助。">
- </TextView>
- <LinearLayout android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="10dp" >
- <Spinner android:id="@+id/feedback_type_spinner"
- android:layout_width="wrap_content"
- android:layout_height="50dp"
- android:layout_weight="1"
- android:focusable="true"
- android:entries="@array/feedback_type"/>
- </LinearLayout>
- <RelativeLayout android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <EditText android:id="@+id/feedback_content"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:maxEms="10"
- android:minEms="10"
- android:hint="请输入您的反馈意见(字数500以内)"
- android:gravity="top"
- android:layout_marginBottom="50dip"/>
- <Button android:id="@+id/feedback_submit"
- android:layout_width="fill_parent"
- android:layout_height="50dp"
- android:text="提交反馈"
- android:textSize="19dp"
- android:layout_gravity="center_horizontal"
- android:layout_alignParentBottom="true"/>
- </RelativeLayout>
- </LinearLayout>
- </LinearLayout>
运行截图如下:

备注:
在打开的activity界面中如果包含有EditText控件,那么android默认会打开键盘输入法,但是很多时候不需要,可以通过下面的代码隐藏掉键盘:
- getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
android布局自适应小示例(用户反馈界面)的更多相关文章
- android+json+php+mysql实现用户反馈功能
相信每个项目都会有用户反馈建议等功能,这个实现的方法很多,下面是我实现的方法,供大家交流.首先看具体界面,三个字段.名字,邮箱为选填,可以为空,建议不能为空.如有需要可以给我留言. 下面贴出布局代码, ...
- 小程序用户反馈 - HotApp小程序统计仿微信聊天用户反馈组件,开源
用户反馈是小程序开发必要的一个功能,但是和自己核心业务没关系,主要是产品运营方便收集用户的对产品的反馈.HotApp推出了用户反馈的组件,方便大家直接集成使用 源码下载地址: https://gith ...
- Android开发之JavaMail发送邮件(用户反馈)
给APP增加了一个用户反馈的小功能,由于懒的搭服务器,所以就用邮件的形式进行通信,有如下两种方式: 1.使用调用手机上的其他程序完成邮件发送 2.使用javamail进行邮件发送 这里果断使用java ...
- Android:布局实例之常见用户设置界面
实现效果: 整理思路: 1.控件:文字TextView 和 右箭头ImageView 2.因为考虑到点击效果,设计为:最外层为全圆角,内层有四种情况,分别为上圆角.无圆角.下圆角和全圆角. 3.内层样 ...
- Android 布局自适应屏幕
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvenFzNjI3NjExMzA=/font/5a6L5L2T/fontsize/400/fill/I0JBQk ...
- Android基础总结(3)——UI界面布局
Android的UI设计有好几种界面程序编写方式.大体上可分为两大类:一类是利用可视化工具来进行,允许你进行拖拽控件来进行布局:还有一类是编写xml文档来进行布局.这两种方法可以相互转换. 1.常见的 ...
- Android监听自身卸载,弹出用户反馈调查
1,情景分析 在上上篇博客中我写了一下NDK开发实践项目,使用开源的LAME库转码MP3,作为前面几篇基础博客的加深理解使用的,但是这样的项目用处不大,除了练练NDK功底.这篇博客,我将讲述一下一个各 ...
- Android 应用监听自身卸载,弹出用户反馈调查
监听卸载情景和原理分析 1,情景分析 在上上篇博客中我写了一下NDK开发实践项目,使用开源的LAME库转码MP3,作为前面几篇基础博客的加深理解使用的,但是这样的项目用处不大,除了练练NDK功底.这篇 ...
- Sprint 5 summary: UI 界面更新,Azure端部署和用户反馈分析 12/28/2015
本次sprint主要完成的任务有对手机APP的UI界面的更新,同时对Azure客户端的部署进行了相应的学习和有关的程序设计.同时对于ALPHA release的用户反馈做出相应的分析以确定接下来工作的 ...
随机推荐
- 织梦(Dedecms) 5.1 feedback_js.php 注入漏洞
漏洞版本: DEDECMS 5.1 漏洞描述: 同样是在magic_quotes_gpc=off的情况下可用 此漏洞可拿到后台管理员的帐号和加密HASH,漏洞存在文件plus/feedback_js. ...
- DGN格式转化为shp格式 【转】
其实本来,我就是需要把一个autocad的dwg/dgn格式的东西导入到google earth里面:但是首先我对dwg/dgn格式的东西根本就不熟:其次我拿到的dwg/dgn格式文件是用的HK80 ...
- 从AIDL开始谈Android进程间Binder通信机制
转自: http://tech.cnnetsec.com/585.html 本文首先概述了Android的进程间通信的Binder机制,然后结合一个AIDL的例子,对Binder机制进行了解析. 概述 ...
- 数组根据index拆分和查询下标
private class ArrayTool<T> { /// <summary>查询值在数组中的下标</summary> /// <param name= ...
- .NET破解之爱奇迪(三)
本教程只能用于学习研究,不可进行任何商业用途.如有使用,请购买正版,尊重他人劳动成果和知识产权! .NET破解之爱奇迪(一) .NET破解之爱奇迪(二) 一打开软件,就看到各种注册和未注册提示信息,就 ...
- Python中的作用域
Python中的作用域 Python 中,一个变量的作用域总是由在代码中被赋值的地方所决定的. 当 Python 遇到一个变量的话他会按照这样的顺序进行搜索: 本地作用域(Local)→当前作用域被嵌 ...
- zoj3662Math Magic
Math Magic Time Limit: 3 Seconds Memory Limit: 32768 KB Yesterday, my teacher taught us about ...
- ant design 中的 Select 组件常规写法
1.代码 import { Select, Spin } from 'antd'; const Option = Select.Option; <Select allowClear showSe ...
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'statisticalMapper' defined in file
::, [localhost-startStop-1] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFact ...
- Java之进阶(1) -《Effective Java》
第1章 引言 第2章 创建和销毁对象 第1条:考虑用静态工厂方法代替构造器(Consider static factory methods instead of constructors) 第2条:遇 ...