![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android UI
ProgramerQ
I am Walter,WalterBryant.
展开
-
ScrollView 嵌套 ListView 只显示第一行的源码分析
要带着问题来阅读源码,解惑以满足心中的好奇心,知其然并知其所以然,了解发现 Google 工程师的代码设计原理。1、猜测是在 onMeasure 的时候,只测量了第一个 item。在 MeasureSpec.UNSPECIFIED 的时候,只是拿到了 第 1 个 item 的高度。在 MeasureSpec.AT_MOST 的时候,会把 ListView 的 view 全部加载。推测在 ...原创 2018-09-25 23:36:28 · 230 阅读 · 0 评论 -
调用了 LinearLayout .scrollBy(-20, 0)
Q:现在有个 LinearLayout 里面水平放置了两个 ImageView,接着调用了linearlayout.scrollBy (-20, 0)。两个子view从视觉上确实右移了。我想着 scroll 是移动了内容,那么子 view 的 left 或者 translationX 应该有一个变化了吧,结果是都没有变化。那么问题来了,移动内容到底移动的是啥?A: scrollTo 和 scro...原创 2018-12-13 09:57:03 · 211 阅读 · 0 评论 -
Android CheckBox设置不可点击
checkBox.setClickable(false);或者checkBox.setEnalbe(false);原创 2018-12-28 13:32:24 · 11397 阅读 · 0 评论 -
Android 加载长图片(类似微博长图)
巨图片加载,android BitmapRegionDecoder .1、BitmapRegionDecoder.newInstance();2、bitmap = mDecoder.decodeRegion(mRect, mOptions);直接代码见:https://github.com/WalterBryant/LongImageView...原创 2019-01-08 23:13:57 · 943 阅读 · 0 评论 -
Android Paint -- 基本使用方法
Paint画笔的基本使用1、Paint画笔画图形、路径2、Paint画笔来画文字Paint.FontMetricsPaint.FontMetricsInt里面有top,ascent,desent, bottom, leading这几个属性top = top线的y坐标 - baseline线的y坐标bottom = bottom线的y坐标 - baseline线的y坐标ascent ...原创 2019-04-18 14:23:47 · 398 阅读 · 0 评论