Android中控件的使用

1.ConstraintLayout这个属性是Android推出来的布局之一,大家一般用的很少,今天看下它有什么属性吧

<android.support.constraint.ConstraintLayout
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"
tools:context="tech.michaelx.readsms.MainActivity">

<EditText
android:id="@+id/code_et"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:hint="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHorizontal_bias="0.1"
app:layout_constraintVertical_bias="0.1" />

  用起来还是很不错的

 2..FlexboxLayout    也去去年Google推出来的,FlexboxLayout 可以理解为高级的 LinearLayout .它有着换行的作用在某些方面和FlowLayout差不多

3.我们可以写自定义组合控件,很早我就对这个有了想法,把布局封装成一个强大基类,它可以自定义布局,省去每次自己写,这个哥们也是很牛比!!!各种自定View实现

然而我感觉这个并不实用,不过可以参考下,我觉得他是写静态界面并不能做修改,优化布局可以看下这个,同时作者很用心,整理的都是很干的,很值得学习

都在这里

4.我们要可以对输入Text做些处理,   本作者写过RxJava很不错

 5.我们经常有登录时要对用户输入的内容进行判断,很不错

参考文章

6,gridView, 这个关于GridVew的写法,效果也很不错的

7,recyclerView, 这个基类真的很强大以下是我参照写出来的效果,都是用的RecyclerView

 

1.导入recyclerView

  compile 'com.android.support:recyclerview-v7:25.3.1'

2.在主gradle 中导入

allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" } //BaseRecyclerViewAdapterHelper
}
}

3.在项目gradle中导入

compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.13' 

4.要解决滑动的问题,完美解决

 8.我常常会遇到像ios一样可以可以随意的用一个时间控件,今天给大家推荐一歀

9.本文作者很用心良苦,我很喜欢,gitHub写的是一个仿微信返回的效果,本人集成完成实现

这个更是棒棒达

 10.这里有自定义进度条,还 有上传项目到gitHub的方法

 11.购物车里用到的,抛物线

 12.新手引导页很不错,  继续高亮


13.Dialog的封装,常见的打开相册,选地图功能,都可以实现的
 
原文地址:https://www.cnblogs.com/dubo-/p/7062129.html