本文整理匯總了Java中android.widget.TextView.getCompoundPaddingTop方法的典型用法代碼示例。如果您正苦於以下問題:Java TextView.getCompoundPaddingTop方法的具體用法?Java TextView.getCompoundPaddingTop怎麽用?Java TextView.getCompoundPaddingTop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.TextView
的用法示例。
在下文中一共展示了TextView.getCompoundPaddingTop方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: CsDrawableTouchUtils
import android.widget.TextView; //導入方法依賴的package包/類
CsDrawableTouchUtils(MotionEvent event, TextView view, boolean isLayoutRTL){
this.event = event;
this.view = view;
this.isLayoutRTL = isLayoutRTL;
vSpace = view.getHeight() - view.getCompoundPaddingBottom() - view.getCompoundPaddingTop();
hSpace = view.getWidth() - view.getCompoundPaddingRight() - view.getCompoundPaddingLeft();
//if the drawable is extremely large (pushing the edges of the drawable itself
//or of the other drawables out of the current view bounds, will not be possible
//to calculate the correct touch position
if (hSpace < 0 || vSpace < 0){
throw new IllegalArgumentException("The size of one of your drawable is exceeding the" +
" calculated width or height of the view. In this case you should provide" +
"a smaller drawable or provide a smaller dimension in XML or with the builder");
}
scrollX = view.getScrollX();
scrollY = view.getScrollY();
}
示例2: getRealTextViewHeight
import android.widget.TextView; //導入方法依賴的package包/類
/**
* 獲取內容tv真實高度(含padding)
* @param textView
* @return
*/
private static int getRealTextViewHeight( TextView textView) {
int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
return textHeight + padding;
}
示例3: getRealTextViewHeight
import android.widget.TextView; //導入方法依賴的package包/類
private static int getRealTextViewHeight(@NonNull TextView textView) {
int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
return textHeight + padding;
}
示例4: getRealTextViewHeight
import android.widget.TextView; //導入方法依賴的package包/類
/**
* 獲取內容tv真實高度(含padding)
*/
private static int getRealTextViewHeight(TextView textView) {
int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
return textHeight + padding;
}
示例5: getRealTextViewHeight
import android.widget.TextView; //導入方法依賴的package包/類
private static int getRealTextViewHeight(TextView textView) {
int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
return textHeight + padding;
}
示例6: getRealTextViewHeight
import android.widget.TextView; //導入方法依賴的package包/類
/**
* 獲取內容tv真實高度(含padding)
*
* @param textView
* @return
*/
private static int getRealTextViewHeight(TextView textView) {
int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
return textHeight + padding;
}