本人android studio版本是 3.4.1,设计了一个任务内容和识别内容的界面,欢迎大家品尝。

界面显示如下图所示:

实现代码如下:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent"
  7. android:orientation="vertical"
  8. >
  9.  
  10. <LinearLayout
  11. android:layout_width="match_parent"
  12. android:layout_height="wrap_content"
  13. android:layout_weight="2"
  14. android:orientation="horizontal"
  15. >
  16. <LinearLayout
  17. android:layout_width="match_parent"
  18. android:layout_height="match_parent"
  19. android:orientation="vertical"
  20. >
  21.  
  22. <TextView
  23. android:layout_width="wrap_content"
  24. android:layout_height="wrap_content"
  25. android:layout_weight="1"
  26. android:text="任 务 内 容"
  27. android:textSize="16sp"
  28. android:gravity="bottom"
  29. android:layout_marginLeft="10dp"
  30. />
  31. <LinearLayout
  32. android:layout_width="match_parent"
  33. android:layout_height="0dp"
  34. android:orientation="horizontal"
  35. android:layout_weight="3"
  36. android:gravity="center"
  37. android:padding="0dp"
  38. >
  39. <TextView
  40. android:id="@+id/show1"
  41. android:layout_weight="1"
  42. android:layout_width="0dp"
  43. android:layout_height="match_parent"
  44. android:layout_margin="10dp"
  45. android:background="@drawable/shapeshow"
  46. android:textColor="@color/colortheme" />
  47. <TextView
  48. android:id="@+id/show2"
  49. android:layout_weight="1"
  50. android:layout_width="0dp"
  51. android:layout_height="match_parent"
  52. android:layout_margin="10dp"
  53. android:background="@drawable/shapeshow"
  54. android:textColor="@color/colortheme" />
  55. <TextView
  56. android:id="@+id/show3"
  57. android:layout_weight="1"
  58. android:layout_width="0dp"
  59. android:layout_height="match_parent"
  60. android:layout_margin="10dp"
  61. android:background="@drawable/shapeshow"
  62. android:textColor="@color/colortheme" />
  63.  
  64. </LinearLayout>
  65. </LinearLayout>
  66. </LinearLayout>
  67.  
  68. <LinearLayout
  69. android:layout_width="match_parent"
  70. android:layout_height="wrap_content"
  71. android:layout_weight="2"
  72. android:orientation="horizontal"
  73. >
  74. <LinearLayout
  75. android:layout_width="match_parent"
  76. android:layout_height="match_parent"
  77. android:orientation="vertical"
  78. >
  79.  
  80. <TextView
  81. android:layout_width="wrap_content"
  82. android:layout_height="wrap_content"
  83. android:layout_weight="1"
  84. android:text="识 别 内 容"
  85. android:textSize="16sp"
  86. android:gravity="bottom"
  87. android:layout_marginLeft="10dp"
  88. />
  89. <LinearLayout
  90. android:layout_width="match_parent"
  91. android:layout_height="0dp"
  92. android:orientation="horizontal"
  93. android:layout_weight="3"
  94. android:gravity="center"
  95. >
  96. <ImageView
  97. android:layout_weight="0.5"
  98. android:layout_width="0dp"
  99. android:layout_height="match_parent"
  100. android:layout_marginLeft="10dp"
  101. android:src="@drawable/ic_account_box_black_24dp"
  102. />
  103. <EditText
  104. android:layout_weight="2"
  105. android:layout_width="0dp"
  106. android:layout_height="wrap_content"
  107. android:background="@drawable/shapesinput"
  108. android:layout_marginLeft="10dp"
  109. android:layout_marginRight="10dp"
  110.  
  111. />
  112. <EditText
  113. android:layout_weight="3"
  114. android:layout_width="0dp"
  115. android:layout_height="wrap_content"
  116. android:background="@drawable/shapesinput"
  117. android:layout_marginLeft="10dp"
  118. android:layout_marginRight="10dp"
  119. />
  120. </LinearLayout>
  121. <LinearLayout
  122. android:layout_width="match_parent"
  123. android:layout_height="0dp"
  124. android:orientation="horizontal"
  125. android:layout_weight="3"
  126. android:gravity="center"
  127. >
  128. <ImageView
  129. android:layout_weight="0.5"
  130. android:layout_width="0dp"
  131. android:layout_height="match_parent"
  132. android:layout_marginLeft="10dp"
  133. android:src="@drawable/ic_monetization_on_black_24dp"
  134. />
  135. <EditText
  136. android:layout_weight="2"
  137. android:layout_width="0dp"
  138. android:layout_height="wrap_content"
  139. android:background="@drawable/shapesinput"
  140. android:layout_marginLeft="10dp"
  141. android:layout_marginRight="10dp"
  142.  
  143. />
  144. <EditText
  145. android:layout_weight="3"
  146. android:layout_width="0dp"
  147. android:layout_height="wrap_content"
  148. android:background="@drawable/shapesinput"
  149. android:layout_marginLeft="10dp"
  150. android:layout_marginRight="10dp"
  151. />
  152.  
  153. </LinearLayout>
  154. <LinearLayout
  155. android:layout_width="match_parent"
  156. android:layout_height="0dp"
  157. android:orientation="horizontal"
  158. android:layout_weight="3"
  159. android:gravity="center"
  160. >
  161. <ImageView
  162. android:layout_weight="0.5"
  163. android:layout_width="0dp"
  164. android:layout_height="match_parent"
  165. android:layout_marginLeft="10dp"
  166. android:src="@drawable/ic_watch_black_24dp"
  167. />
  168. <EditText
  169. android:layout_weight="2"
  170. android:layout_width="0dp"
  171. android:layout_height="wrap_content"
  172. android:background="@drawable/shapesinput"
  173. android:layout_marginLeft="10dp"
  174. android:layout_marginRight="10dp"
  175.  
  176. />
  177. <EditText
  178. android:layout_weight="3"
  179. android:layout_width="0dp"
  180. android:layout_height="wrap_content"
  181. android:background="@drawable/shapesinput"
  182. android:layout_marginLeft="10dp"
  183. android:layout_marginRight="10dp"
  184. />
  185.  
  186. </LinearLayout>
  187. </LinearLayout>
  188. </LinearLayout>
  189.  
  190. <LinearLayout
  191. android:layout_width="wrap_content"
  192. android:layout_height="wrap_content"
  193. android:layout_weight="1"
  194. >
  195.  
  196. <RelativeLayout
  197. android:layout_width="match_parent"
  198. android:layout_height="match_parent"
  199. >
  200. <Button
  201. android:id="@+id/pass"
  202. android:layout_width="wrap_content"
  203. android:layout_height="wrap_content"
  204. android:layout_centerVertical="true"
  205. android:layout_marginLeft="40dp"
  206. android:text="通过"
  207. android:textSize="16dp"
  208. android:textColor="#fff"
  209. android:background="@drawable/shapesbutton"
  210. />
  211. <Button
  212. android:id="@+id/not_pass"
  213. android:layout_width="wrap_content"
  214. android:layout_height="wrap_content"
  215. android:layout_alignParentEnd="true"
  216. android:layout_alignParentRight="true"
  217. android:layout_centerVertical="true"
  218. android:layout_marginEnd="40dp"
  219. android:layout_marginRight="40dp"
  220. android:background="@drawable/shapesbutton"
  221. android:text="不通过"
  222. android:textColor="#fff"
  223. android:textSize="16dp" />
  224.  
  225. </RelativeLayout>
  226. </LinearLayout>
  227. </LinearLayout>
  1.  
  2. 其中, 以下是 shapesbutton.xml 的代码, 而其他的shape代码大同小异, 只要修改其中的参数就可以变成想要的形状和颜色
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <shape xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:shape="rectangle">
  4. <solid
  5. android:color="#008577">
  6. </solid>
  7.  
  8. <corners
  9. android:radius="10dp">
  10. </corners>
  11.  
  12. <stroke
  13. android:width="2dp"
  14. android:color="#008577">
  15. </stroke>
  16.  
  17. <padding
  18. android:top="0dp"
  19. android:right="20dp"
  20. android:left="20dp"
  21. android:bottom="0dp">
  22. </padding>
  23. </shape>
  1. 其中,关于图标文件的创建,右击 drawable, 选择 new, 选择 Vector Asset 进入界面, 再点击 Clip Art 选择自己想要的图标, 点击 next finish 即可.若想要修改图标的颜色, 则可以打开图标文件, 修改 fillColor即可.

android studio 设计任务内容和识别内容界面 (android stuido design task layout)的更多相关文章

  1. Android Studio软件技术基础 —Android项目描述---1-类的概念-android studio 组件属性-+标志-Android Studio 连接真机不识别其他途径

    学习android对我来说,就是兴趣,所以我以自己的兴趣写出的文章,希望各位多多支持!多多点赞,评论讨论加关注. 最近有点忙碌,对于我来说,学习Android开发,是对于我的考验,最近一位大佬发给我一 ...

  2. 【Android Studio安装部署系列】二十一、Android studio将项目上传到github中

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 两个相关概念:git和github Git是一个开源的分布式版本控制系统,用以有效.高速的处理从很小到非常大的项目版本管理.Git ...

  3. Android studio 使用心得(三)—从Eclipse迁移到Android studio

    断断续续的也算是把eclipse上的代码成功迁移到android studio上来了,现在,我同事继续用eclipse,我用android studio,svn上还是之前eclipse的项目,迁移成功 ...

  4. 【Android Studio探索之路系列】之中的一个:Android Studio开篇

    作者:郭孝星 微博:郭孝星的新浪微博 邮箱:allenwells@163.com 博客:http://blog.csdn.net/allenwells github:https://github.co ...

  5. Android Studio 连接真机不识别

    本人也是初学..写错的请大神多多批评指正! 不胜荣幸!! 强烈推荐使用真机测试..除非是最后关头要测试各个Android系统版本.. 本人遇到的连不上的原因有以下几种: 1  --   手机设置问题. ...

  6. 【Android Studio安装部署系列】十九、Android studio使用SVN

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 在AndroidStudio中开发版本控制,除了Git就是SVN,和Eclipse不同,Android Studio没有提供单独的插 ...

  7. 【Android Studio安装部署系列】四十、Android Studio安装Statistic插件(统计项目总行数)

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 Android Studio 是没有提提供统计代码全部行数的功能的,但是对于开发者来说,这个功能确实必备的,Statistic统计代 ...

  8. [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 [ ...

  9. Android Studio 使用笔记:[转] Mac下修改Android Studio 所用的JDK版本

    原文链接:http://www.jianshu.com/p/d8d1d72d0248# 最近项目从Eclipse+Ant构建模式转移到了Android Studio+Gradle构建模式,自然的JDK ...

随机推荐

  1. zabbix自带database monitor

    1. 在zabbix服务器上安装一下两个包: # yum -y install unixODBC mysql-connector-odbc 2. 修改zabbix服务器上ODBC配置: 2.1 Vim ...

  2. ubuntu Oracle SQL Developer 安装

    一. 官网下载oracle 安装包 二.下载完毕后,检查你的Ubuntu是否安装了tar和alien sudo apt-get install tar sudo apt-get install ali ...

  3. 利用PHP和百度ai实现文本以及图片的审核

    步骤: 首先打开百度ai 开发平台 注册一个账号: 注册账号,进入控制台 创建自己的应用,获取apikey 和秘钥 进入文档页 文本审核: 图像审核: 代码实例: class Sentive { pr ...

  4. Web源码泄露总结

    Web源码泄露总结 背景 本文主要是记录一下常见的源码泄漏问题,这些经常在web渗透测试以及CTF中出现. 源码泄漏分类 .hg源码泄漏 漏洞成因: hg init的时候会生成.hg e.g.http ...

  5. win10 解决telnet不是内部或外部命令的方案

    1.Telnet用于远程操作互联网中的设备或终端计算机服务器,可以有效的减少现场操作的麻烦.因为设备或终端是遍布整个省或市,有的甚至是国外,如何高效的处理问题是当务之急,除了telnet还可以ssh使 ...

  6. CDN技术之-介绍

    “第一公里”是指万维网流量向用户传送的第一个出口,是网站服务器接入互联网的链路所能提供的带宽.这个带宽决定了一个网站能为用户提供的访问速度和并发访问量.如果业务繁忙,用户的访问数越多,拥塞越严重,网站 ...

  7. [CSP-S模拟测试]:斯诺(snow)(数学+前缀和+树状数组)

    题目传送门(内部题37) 输入格式 第一行一个整数$n$,表示区间的长度. 第二行一个长度为$n$的只包含$0,1,2$的字符串,表示给出的序列. 输出格式 一行一个整数,表示革命的区间的数量. 样例 ...

  8. 前端每日实战:73# 视频演示如何用纯 CSS 创作一只卡通狐狸

    效果预览 按下右侧的"点击预览"按钮可以在当前页面预览,点击链接可以全屏预览. https://codepen.io/comehope/pen/OEKZed 可交互视频 此视频是可 ...

  9. 团队冲刺DAY3

    DESUtil.java是包含加密解密抽象类的Java文件 DES全称为Data Encryption Standard,即数据加密标准,是一种使用密钥加密的块算法,1977年被美国联邦政府的国家标准 ...

  10. linux下关闭Oracle及关机

    参考了如下文章 linux环境下连接oracle 并操作oracle数据库 1 先看lsnrctl和oracle service是否都启动了.如果没有启动,先启动:如net start,启动所有服务. ...