![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android 干货
神农马
这个作者很懒,什么都没留下…
展开
-
ConstraintLayout处理标签跟随在最后面
ConstraintLayout处理标签跟随在最后面。原创 2023-05-05 18:03:51 · 63 阅读 · 0 评论 -
上百个流行框架
Android框架排行榜1.Retrofit一句话介绍:Retrofit是一款类型安全的网络框架,基于HTTP协议,服务于Android和java语言上榜理由:Retrofit以21.8k的stars量雄踞github中android子标题榜首,第一当之无愧。官网地址:http://square.github.io/retrofit/github:https://github.com/s...转载 2019-06-29 15:09:27 · 446 阅读 · 0 评论 -
ShapeTextView
我不太喜欢单独做个shape.xml 来作为背景、于是整合了自定义ShapeTextViewpublic class ShapeTextView extends AppCompatTextView {private float cornersRadius;//文本圆角private int solidColor;//背景色private float strokeWidth;//边框宽度p...原创 2019-04-30 10:10:12 · 251 阅读 · 0 评论 -
AAPT2 error: check logs for details
遇到这个问题我也是比较纳闷、为什么纳闷呢、我来说说我的场景~本人开发的是多人项目、也算是个老项目、各种SDK、buildTool 相对都比较低,今天突然接到一个新的任务、单独做个小工具于是新开了一个工程、此时在引用库的时候都把版本号调到最大(Android Studio 3.3.1 当某些引入库有新版本时会标黄,对于有洁癖的我习惯升级版本)因为是新项目嘛、倒是顺风顺水非常happy 的完成...原创 2019-04-23 10:21:01 · 795 阅读 · 0 评论 -
RadioButton drawableRight与drawableEnd同时使用导致默认选中失效
**RadioButton drawableRight与drawableEnd同时使用导致默认选中失效如上我们只单单设置android:drawableRight,android studio3.0以上会标黄、我们ALT+ENTER 会帮我们自动加上android:drawableEnd此时android:checked=“true” 则会失效PS:如果你的Activity继承了Sta...原创 2019-03-28 09:36:09 · 908 阅读 · 0 评论 -
合并两张Drawable 资源图片
简单的介绍两个Drawable,合并成一张bitmap,至于有什么用跟使用场景,您看着办吧~直接上代码: public static Bitmap margeBitmap(Context context,int id1,int id2){ Bitmap backBitmap = Bitmap.createBitmap(BitmapFactory.decodeResource(co...原创 2019-01-24 15:33:21 · 1485 阅读 · 0 评论 -
RelativeLayout和LinearLayout性能比较 相对布局和线性布局的性能比较(结论)
相对布局和线性布局的性能比较(结论)(1)RelativeLayout会让子View调用2次onMeasure,LinearLayout 在有weight时,也会调用子View 2次onMeasure(2)RelativeLayout的子View如果高度和RelativeLayout不同,则会引发效率问题,当子View很复杂时,这个问题会更加 严重。如果可...转载 2018-05-08 11:22:26 · 1308 阅读 · 0 评论 -
android 定时器(Handler Timer Thread AlarmManager CountDownTimer)
此博客转自 链接android 定时器(Handler Timer Thread AlarmManager CountDownTimer)Android实现定时任务一般会使用以上(Handler Timer Thread AlarmManager CountDownTimer)五种方式。当然还有很多组合使用(比如Handler+Thread 比如Handler类自带的postDelye转载 2018-01-16 10:59:04 · 298 阅读 · 0 评论 -
DialogFragme 与 Dialog 的区别
顾名思义,DialogFragment 拥有Fragment的属性 即继承自Fragment。 用DialogFragment 最经典的案例是,1、旋转屏幕,需要对界面进行重汇保存状态savedInstanceState 2、你在DialogFragment 显示的界面有按钮点击跳转到新的Activity时、返回时的一个savedInstanceState如果你的APP是固定竖屏的、打开别原创 2018-01-23 11:29:31 · 645 阅读 · 0 评论 -
RecyclerView 滚动到指定position与偏移
RecyclerView 滚动到指定position与偏移scrollToPositionWithOffset(position,offset)LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager(); offsetY = -DisplayUtils.dip2px(this,7原创 2018-01-03 11:24:47 · 6364 阅读 · 2 评论