摘要:
RecyclerView getChildAdapterPosition(View):获取View在Adapter中的position。 getChildLayoutPosition(View):获取view在layout中的position。注意:大部分情况下,它与getChildAdapterP 阅读全文
摘要:
1. FontMetrics 计算文本高度: fontMetrics.bottom - fontMetrics.top 2. measureText 通过这个方法即可以轻松的获取到文字的的宽度。比如要获取一个TextView中文本的宽度:textView.getPaint().measureText 阅读全文
摘要:
嫌麻烦可以直接看结论: 文本居中的公式: float baseLineY = centerY + (Math.abs(fontMetrics.top) + Math.abs(fontMetrics.bottom)) /2 - fontMetrics.bottom 也可以简化成: float base 阅读全文