android studio 设计任务内容和识别内容界面 (android stuido design task layout)
本人android studio版本是 3.4.1,设计了一个任务内容和识别内容的界面,欢迎大家品尝。
界面显示如下图所示:
实现代码如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns: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"
> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="任 务 内 容"
android:textSize="16sp"
android:gravity="bottom"
android:layout_marginLeft="10dp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight="3"
android:gravity="center"
android:padding="0dp"
>
<TextView
android:id="@+id/show1"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:background="@drawable/shapeshow"
android:textColor="@color/colortheme" />
<TextView
android:id="@+id/show2"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:background="@drawable/shapeshow"
android:textColor="@color/colortheme" />
<TextView
android:id="@+id/show3"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:background="@drawable/shapeshow"
android:textColor="@color/colortheme" /> </LinearLayout>
</LinearLayout>
</LinearLayout> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="识 别 内 容"
android:textSize="16sp"
android:gravity="bottom"
android:layout_marginLeft="10dp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight="3"
android:gravity="center"
>
<ImageView
android:layout_weight="0.5"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:src="@drawable/ic_account_box_black_24dp"
/>
<EditText
android:layout_weight="2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/shapesinput"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
<EditText
android:layout_weight="3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/shapesinput"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight="3"
android:gravity="center"
>
<ImageView
android:layout_weight="0.5"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:src="@drawable/ic_monetization_on_black_24dp"
/>
<EditText
android:layout_weight="2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/shapesinput"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
<EditText
android:layout_weight="3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/shapesinput"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
/> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight="3"
android:gravity="center"
>
<ImageView
android:layout_weight="0.5"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:src="@drawable/ic_watch_black_24dp"
/>
<EditText
android:layout_weight="2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/shapesinput"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
<EditText
android:layout_weight="3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/shapesinput"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
/> </LinearLayout>
</LinearLayout>
</LinearLayout> <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
> <RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Button
android:id="@+id/pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="40dp"
android:text="通过"
android:textSize="16dp"
android:textColor="#fff"
android:background="@drawable/shapesbutton"
/>
<Button
android:id="@+id/not_pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="40dp"
android:layout_marginRight="40dp"
android:background="@drawable/shapesbutton"
android:text="不通过"
android:textColor="#fff"
android:textSize="16dp" /> </RelativeLayout>
</LinearLayout>
</LinearLayout>
其中, 以下是 shapesbutton.xml 的代码, 而其他的shape代码大同小异, 只要修改其中的参数就可以变成想要的形状和颜色
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#008577">
</solid> <corners
android:radius="10dp">
</corners> <stroke
android:width="2dp"
android:color="#008577">
</stroke> <padding
android:top="0dp"
android:right="20dp"
android:left="20dp"
android:bottom="0dp">
</padding>
</shape>
其中,关于图标文件的创建,右击 drawable, 选择 new, 选择 Vector Asset 进入界面, 再点击 Clip Art 选择自己想要的图标, 点击 next 和 finish 即可.若想要修改图标的颜色, 则可以打开图标文件, 修改 fillColor即可.
android studio 设计任务内容和识别内容界面 (android stuido design task layout)的更多相关文章
- Android Studio软件技术基础 —Android项目描述---1-类的概念-android studio 组件属性-+标志-Android Studio 连接真机不识别其他途径
学习android对我来说,就是兴趣,所以我以自己的兴趣写出的文章,希望各位多多支持!多多点赞,评论讨论加关注. 最近有点忙碌,对于我来说,学习Android开发,是对于我的考验,最近一位大佬发给我一 ...
- 【Android Studio安装部署系列】二十一、Android studio将项目上传到github中
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 两个相关概念:git和github Git是一个开源的分布式版本控制系统,用以有效.高速的处理从很小到非常大的项目版本管理.Git ...
- Android studio 使用心得(三)—从Eclipse迁移到Android studio
断断续续的也算是把eclipse上的代码成功迁移到android studio上来了,现在,我同事继续用eclipse,我用android studio,svn上还是之前eclipse的项目,迁移成功 ...
- 【Android Studio探索之路系列】之中的一个:Android Studio开篇
作者:郭孝星 微博:郭孝星的新浪微博 邮箱:allenwells@163.com 博客:http://blog.csdn.net/allenwells github:https://github.co ...
- Android Studio 连接真机不识别
本人也是初学..写错的请大神多多批评指正! 不胜荣幸!! 强烈推荐使用真机测试..除非是最后关头要测试各个Android系统版本.. 本人遇到的连不上的原因有以下几种: 1 -- 手机设置问题. ...
- 【Android Studio安装部署系列】十九、Android studio使用SVN
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 在AndroidStudio中开发版本控制,除了Git就是SVN,和Eclipse不同,Android Studio没有提供单独的插 ...
- 【Android Studio安装部署系列】四十、Android Studio安装Statistic插件(统计项目总行数)
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 Android Studio 是没有提提供统计代码全部行数的功能的,但是对于开发者来说,这个功能确实必备的,Statistic统计代 ...
- [Unity][安卓]Unity和Android Studio 3.0 交互通讯(1)Android Studio 3.0 设置
[安卓]Android Studio 3.0 JDK安卓环境配置(2017.10) http://blog.csdn.net/bulademian/article/details/78387052 [ ...
- Android Studio 使用笔记:[转] Mac下修改Android Studio 所用的JDK版本
原文链接:http://www.jianshu.com/p/d8d1d72d0248# 最近项目从Eclipse+Ant构建模式转移到了Android Studio+Gradle构建模式,自然的JDK ...
随机推荐
- js 数组、字符串、Json互相转换
arr.join(): 数组转字符串 let arr = [1,2,3,4]; let str = arr.join(','); arr.split():字符串转数组 let str = '1,2,3 ...
- Java线程的优先级设置遵循什么原则?
Java线程的优先级设置遵从下述原则: (1) 线程创建时,子线程继承父线程的优先级 (2) 线程创建后,可在程序中通过调用setPriority( )方法改变线程的优先级 (3) 线程的优先级是1~ ...
- 修改Docker中容器的时间和宿主主机时间一致
修改Docker容器的时间和宿主时间一致 在查看容器的日志的,发现时间有和宿主主机时间相差有8个小时,而且宿主主机使用的是CST时间,容器容器使用的是UTC时间 主机时间 DOCKER容器的时间 世界 ...
- OpenCV常用基本处理函数(4)简单变换,阈值等
几何变换 缩放 img=cv2.imread('messi5.jpg') # 下面的 None 本应该是输出图像的尺寸,但是因为后边我们设置了缩放因子 # 因此这里为 None res=cv2.res ...
- php结合Redis实现100万用户投票项目,并实时查看到投票情况的案例
场景:某网站需要对其项目做一个投票系统,投票项目上线后一小时之内预计有100万用户进行投票,希望用户投票完就能看到实时的投票情况 这个场景可以使用redis+mysql冷热数据交换来解决. 何为冷热数 ...
- 2.第一个Codefirst实例
1.什么是codefirst EF4.1中开始支持Code First .这种方式在领域设计模式中非常有用.使用Code First模式,你可以专注于领域设计,根据需要,为你一个领域的对象创建类集合, ...
- java基础学习笔记四(异常)
Java中的异常 Exception 如图可以看出所有的异常跟错误都继承与Throwable类,也就是说所有的异常都是一个对象. 从大体来分异常为两块: 1.error---错误 : 是指程序无法处理 ...
- Mistakes Collection I
Symbol =>'s meaning: what it used to be like => what it should be. 1) mistake array subscript: ...
- (转)MAVEN的安装和Myeclipse+maven的配置和使用
转:https://blog.csdn.net/shikongshengzhu/article/details/51779159 MAVEN的安装和Myeclipse+maven的配置和使用 步骤如下 ...
- MySQL 5.7配置文件
原文:http://www.voidcn.com/article/p-zrikccdi-hr.html # MySql5.7配置文件my.cnf设置[client]port = 3306socket ...