首页 / ANDROID / 仿知乎Android端回答UI
仿知乎Android端回答UI
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了仿知乎Android端回答UI,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2544字,纯文字阅读大概需要4分钟。
内容图文
个人觉得知乎这个回答界面非常的好看。
首先中间那个卡片,是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>
原文:http://www.cnblogs.com/wzben/p/6118170.html
内容总结
以上是互联网集市为您收集整理的仿知乎Android端回答UI全部内容,希望文章能够帮你解决仿知乎Android端回答UI所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。