本文整理汇总了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);
}