本文整理匯總了Java中android.widget.ScrollView.LayoutParams方法的典型用法代碼示例。如果您正苦於以下問題:Java ScrollView.LayoutParams方法的具體用法?Java ScrollView.LayoutParams怎麽用?Java ScrollView.LayoutParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.ScrollView
的用法示例。
在下文中一共展示了ScrollView.LayoutParams方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setMessage
import android.widget.ScrollView; //導入方法依賴的package包/類
public void setMessage(Spanned spanned) {
ScrollView scrollView = new ScrollView(getContext());
scrollView.setLayoutParams(new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT));
TextView tvMessage = new TextView(getContext(), null,
R.style.dialog_pinterest_text);
tvMessage.setLayoutParams(new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT));
tvMessage.setPadding(contentPadding, contentPadding, contentPadding,
contentPadding);
tvMessage.setLineSpacing(0.0F, 1.3F);
tvMessage.setText(spanned);
tvMessage.setTextColor(getContext().getResources().getColor(
R.color.black));
ScrollView.LayoutParams lp = new ScrollView.LayoutParams(
ScrollView.LayoutParams.MATCH_PARENT,
ScrollView.LayoutParams.WRAP_CONTENT);
scrollView.addView(tvMessage, lp);
setContent(scrollView, 0);
}
示例2: initLayoutParmars
import android.widget.ScrollView; //導入方法依賴的package包/類
private ScrollView.LayoutParams initLayoutParmars() {
ScrollView.LayoutParams layoutParams = new FrameLayout.LayoutParams(350,350);
return layoutParams;
}
示例3: createScroll
import android.widget.ScrollView; //導入方法依賴的package包/類
public static FrameLayout.LayoutParams createScroll(int width, int height, int gravity) {
return new ScrollView.LayoutParams(getSize(width), getSize(height), gravity);
}