仿知乎Android端回答UI

个人觉得知乎这个回答界面非常的好看。
首先中间那个卡片,是cardview。
此外,要隐藏掉导航栏。
然后就是,怎么实现cardview怎么能有一半在蓝色部分呢?
首先要分成两部分,第一部分Textview,是用来显示问题的,然后指定cardview的属性在它下面。
再用一个同样颜色的textview,高度是cardview的一半,也是在第一个Textview的下面,并且在cardview的后面即可。
布局文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" tools:context="com.example.administrator.cardviewtest.MainActivity"> <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#3366cc"
android:id="@+id/title"
android:paddingTop="16dp"
android:paddingBottom="10dp"
android:paddingLeft="18dp"
android:paddingRight="18dp" android:text="知乎回答界面那么好看,到底是怎么写的,求助?"
android:textColor="#ffffff"
android:textSize="20dp" /> <TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#3366cc"
android:layout_below="@+id/title" /> <android.support.v7.widget.CardView android:layout_below="@+id/title"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_width="match_parent"
android:layout_height="100dp"
android:id="@+id/view"> <ImageButton
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/head"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:id="@+id/head"
/> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="韦binbin"
android:layout_marginLeft="90dp"
android:layout_marginTop="30dp"
android:textSize="16dp" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Android话题优秀划水者"
android:layout_marginLeft="90dp"
android:layout_marginTop="55dp"
android:textSize="12dp" /> </android.support.v7.widget.CardView> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="谢邀。"
android:layout_below="@+id/view"
android:layout_alignLeft="@+id/view"
android:layout_alignStart="@+id/view"
android:layout_marginTop="23dp"
android:id="@+id/textView" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="以上。"
android:layout_alignParentBottom="true"
android:layout_alignLeft="@+id/textView"
android:layout_alignStart="@+id/textView"
android:layout_marginBottom="41dp" /> </RelativeLayout>
仿知乎Android端回答UI的更多相关文章
- (原创)高仿360云盘android端的UI实现
		
前些日子几大互联网巨头展开了一轮网盘空间大战.一下子从G级别提高到了T级别.以后谁的空间没有1T估计都不好意思开口了~~~ 试用了一下360云盘的客户端,比较小清新(不是给360打广告~~~).刚好U ...
 - Android端IM应用中的@人功能实现:仿微博、QQ、微信,零入侵、高可扩展
		
本文由“猫爸iYao”原创分享,感谢作者. 1.引言 最近有个需求:评论@人(没错,就是IM聊天或者微博APP里的@人功能),就像下图这样: ▲ 微信群聊界面里的@人功能 ▲ QQ群聊界面里 ...
 - Android 仿知乎创意广告
		
代码地址如下:http://www.demodashi.com/demo/14904.html 一.概述 貌似前段时间刷知乎看到的一种非常有特色的广告展现方式,即在列表页,某一个Item显示背后部分广 ...
 - 仿知乎app登录界面(Material Design设计框架拿来就用的TexnInputLayout)
		
在我脑子里还没有Material Design这种概念,就我个人而言,PC端应用扁平化设计必须成为首选,手当其冲的两款即时通讯旺旺和QQ早就完成UI扁平化的更新,然而客户端扁平化的设计本身就存在天生的 ...
 - 微信小程序开发日记——高仿知乎日报(下)
		
本人对知乎日报是情有独钟,看我的博客和github就知道了,写了几个不同技术类型的知乎日报APP 要做微信小程序首先要对html,css,js有一定的基础,还有对微信小程序的API也要非常熟悉 我将该 ...
 - 微信小程序开发日记——高仿知乎日报(上)
		
本人对知乎日报是情有独钟,看我的博客和github就知道了,写了几个不同技术类型的知乎日报APP 要做微信小程序首先要对html,css,js有一定的基础,还有对微信小程序的API也要非常熟悉 我将该 ...
 - appium 自动化测试之知乎Android客户端
		
appium是一个开源框架,相对来说还不算很稳定.转载请注明出处!!!! 前些日子,配置好了appium测试环境,至于环境怎么搭建,参考:http://www.cnblogs.com/tobecraz ...
 - pc端和android端应用程序测试有什么区别?(ps面试题)
		
pc端和android端应用程序测试有什么区别?(ps面试题) [VIP7]大连-凭海临风(215687736) 2014/4/10 8:56:171.测试环境不同PC平台一般都是windows an ...
 - 【转载】Android端手机测试体系
		
1.冒烟测试 跟web端 的测试流程一样,你拿到一个你们开发做出来的apk首先得去冒烟,也就是保证他的稳定性,指定时间内不会崩溃.这款原生sdk自带的monkey可以当做 我们的测试工具.就跟我之前博 ...
 
随机推荐
- 第一波实习的前端笔记(2)——js.md
			
1.如何解决移动端点透问题? $('xx').on('touchend', function(event){ event.preventDefault(); }) 但是,存在滑动页面会触发问题.期待更 ...
 - java 标识符命名规则
			
标识符:就是给类,接口,方法,变量等起名字. 组成规则: A:英文字母大小写 B:数字字符 C:$和_ 注意事项: A:不能以数字开头 B:不能是Java中的关键字 C:Java语言严格区分大小写 包 ...
 - 2.擦除开发板iNand中的uboot的方法
			
(1)在linux和android系统下,擦除uboot的方法: busybox dd if=/dev/zero of=/dev/block/mmcblk0 bs=512 seek=1 c ...
 - 消息框用法MessageBox
			
关键字:C# MessageBox 消息对话框 在程序中,我们经常使用消息对话框给用户一定的信息提示,如在操作过程中遇到错误或程序异常,经常会使用这种方式给用于以提示.在C#中,MessageBox消 ...
 - CSS样式的插入方式
			
1.外部样式: 当样式需要应用于很多页面时,外部样式表将是理想的选择.<head> <link rel="stylesheet" type="text/ ...
 - linux C学习笔记02--共享内存(进程同步)
			
system V下3中进程同步:共享内存(shared memory),信号量(semaphore)和消息队列(message queue) 调试了下午,终于调通啦! 运行./c.out 输出共享内存 ...
 - noip2006 2^k进制数
			
设r是个2k进制数,并满足以下条件: (1)r至少是个2位的2k进制数. (2)作为2k进制数,除最后一位外,r的每一位严格小于它右边相邻的那一位. (3)将r转换为2进制数q后,则q的总位数不超过w ...
 - XGBoost参数调优完全指南(附Python代码)
			
XGBoost参数调优完全指南(附Python代码):http://www.2cto.com/kf/201607/528771.html https://www.zhihu.com/question/ ...
 - Cannot assign to 'self' outside of a method in the init family
			
今天在重写父类的init方法时报错如下: error:Cannot assign to 'self' outside of a method in the init family 这种问题以前从来没有 ...
 - MATLAB - 练习程序,求灰度图像均值、最大、最小数值
			
clear all; close all; clc img=imread('lena.bmp'); figure; imshow(uint8(img)); [m n]=size(img); img_m ...