本文整理汇总了Java中android.text.Layout.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Layout.getHeight方法的具体用法?Java Layout.getHeight怎么用?Java Layout.getHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.text.Layout
的用法示例。
在下文中一共展示了Layout.getHeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: flushView
import android.text.Layout; //导入方法依赖的package包/类
/**
* Flush view no matter what height and width the {@link WXDomObject} specifies.
* @param extra must be a {@link Layout} object, otherwise, nothing will happen.
*/
private void flushView(Object extra) {
if (extra instanceof Layout &&
getHostView() != null && !extra.equals(getHostView().getTextLayout())) {
final Layout layout = (Layout) extra;
/**The following if block change the height of the width of the textView.
* other part of the code is the same to updateExtra
*/
ViewGroup.LayoutParams layoutParams = getHostView().getLayoutParams();
if (layoutParams != null) {
layoutParams.height = layout.getHeight();
layoutParams.width = layout.getWidth();
getHostView().setLayoutParams(layoutParams);
}
getHostView().setTextLayout(layout);
getHostView().invalidate();
}
}
示例2: getTextLayoutHeight
import android.text.Layout; //导入方法依赖的package包/类
private int getTextLayoutHeight() {
Layout layout = mTextView.getLayout();
return layout == null ? -1 : layout.getHeight();
}
示例3: isOutOfBounds
import android.text.Layout; //导入方法依赖的package包/类
private boolean isOutOfBounds(Layout layout) {
return layout.getHeight() > getMeasuredHeight() - getPaddingBottom() - getPaddingTop();
}