本文整理了Java中android.widget.HorizontalScrollView.addView()
方法的一些代码示例,展示了HorizontalScrollView.addView()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HorizontalScrollView.addView()
方法的具体详情如下:
包路径:android.widget.HorizontalScrollView
类名称:HorizontalScrollView
方法名:addView
暂无
代码示例来源:origin: florent37/ExpansionPanel
@Override
public void addView(View child, ViewGroup.LayoutParams params) {
if (getChildCount() > 0) {
throw new IllegalStateException("ExpansionLayout can host only one direct child");
}
super.addView(child, params);
onViewAdded();
}
代码示例来源:origin: florent37/ExpansionPanel
@Override
public void addView(View child) {
if (getChildCount() > 0) {
throw new IllegalStateException("ExpansionLayout can host only one direct child");
}
super.addView(child);
onViewAdded();
}
代码示例来源:origin: florent37/ExpansionPanel
@Override
public void addView(View child, int index) {
if (getChildCount() > 0) {
throw new IllegalStateException("ExpansionLayout can host only one direct child");
}
super.addView(child, index);
onViewAdded();
}
代码示例来源:origin: florent37/ExpansionPanel
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
if (getChildCount() > 0) {
throw new IllegalStateException("ExpansionLayout can host only one direct child");
}
super.addView(child, index, params);
onViewAdded();
}
代码示例来源:origin: stven0king/JsonHandleView
private void initView(Context context) {
this.mContext = context;
contentView = new LinearLayout(mContext);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
contentView.setLayoutParams(layoutParams);
contentView.setOrientation(LinearLayout.VERTICAL);
horizontalScrollView = new HorizontalScrollView(mContext);
horizontalScrollView.setLayoutParams(layoutParams);
horizontalScrollView.setPadding(12, 12, 12, 0);
horizontalScrollView.addView(contentView);
this.addView(horizontalScrollView);
}
代码示例来源:origin: wanliyang1990/NavigationBar
public NavitationScrollLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
margleft = dip2px(context, 0);
titleLayout = new LinearLayout(context);
LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
titleLayout.setLayoutParams(layoutParams);
titleLayout.setOrientation(LinearLayout.HORIZONTAL);
titleLayout.setGravity(Gravity.CENTER_VERTICAL);
LayoutParams layoutParams2 = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
horizontalScrollView = new HorizontalScrollView(context);
horizontalScrollView.addView(titleLayout, layoutParams2);
horizontalScrollView.setHorizontalScrollBarEnabled(false);
addView(horizontalScrollView);
}
代码示例来源:origin: jakebonk/BoardView
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mRootLayout = new HorizontalScrollView(getContext());
mRootLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
mParentLayout = new LinearLayout(getContext());
mParentLayout.setOrientation(LinearLayout.HORIZONTAL);
mScroller = new Scroller(mRootLayout.getContext(), new DecelerateInterpolator(1.2f));
mParentLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
mRootLayout.addView(mParentLayout);
addView(mRootLayout);
SetColumnSnap(true);
}
代码示例来源:origin: Wilm0r/giggity
public NestedScroller(Activity ctx, int flags) {
super(ctx);
ctx_ = ctx;
flags_ = flags;
scaleX = scaleY = 1;
vscroll = new InnerScroller();
super.addView(vscroll, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
vscroll.setVerticalScrollBarEnabled(false);
setHorizontalScrollBarEnabled(false);
vscroll.getViewTreeObserver().addOnScrollChangedListener(vscroll);
}
代码示例来源:origin: KCrason/DynamicPagerIndicator
public void setViewPager(ViewPager viewPager) {
if (viewPager == null || viewPager.getAdapter() == null) {
throw new RuntimeException("viewpager or pager adapter is null");
}
this.mViewPager = viewPager;
viewPager.addOnPageChangeListener(this);
updateIndicator();
if (mPagerIndicatorMode == INDICATOR_MODE_SCROLLABLE) {
LinearLayout linearLayout = new LinearLayout(mContext);
LinearLayout.LayoutParams linearLayoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
linearLayout.setLayoutParams(linearLayoutParams);
linearLayout.setOrientation(VERTICAL);
linearLayout.addView(mTabParentView);
linearLayout.addView(addScrollableLine());
mAutoScrollHorizontalScrollView = new HorizontalScrollView(mContext);
LinearLayout.LayoutParams scrollLayoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
mAutoScrollHorizontalScrollView.setLayoutParams(scrollLayoutParams);
mAutoScrollHorizontalScrollView.setHorizontalScrollBarEnabled(false);
mAutoScrollHorizontalScrollView.addView(linearLayout);
addView(mAutoScrollHorizontalScrollView);
} else {
addView(mTabParentView);
addView(addScrollableLine());
}
}
代码示例来源:origin: fengmaolian/LoginAndShare
llPlat.setLayoutParams(new HorizontalScrollView.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
sv.addView(llPlat);
代码示例来源:origin: AndroidKun/XTabLayout
super.addView(mTabStrip, 0, new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
代码示例来源:origin: WiInputMethod/VE
public void create(int direction, Context context) {
super.create(context);
outerLayoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
innerLayoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutforWrapButtons = new LinearLayout(context);
res = context.getResources();
this.direction = direction;
if (direction == horizontal) {
horizontalScrollView = new HorizontalScrollView(context);
horizontalScrollView.setSmoothScrollingEnabled(true);//很必须,勿删
horizontalScrollView.setHorizontalScrollBarEnabled(false);
layoutforWrapButtons.setOrientation(LinearLayout.HORIZONTAL);
horizontalScrollView.addView(layoutforWrapButtons, innerLayoutParams);
} else if (direction == vertical) {
scrollView = new ScrollView(context);
scrollView.setSmoothScrollingEnabled(true);
scrollView.setScrollbarFadingEnabled(false);
layoutforWrapButtons.setOrientation(LinearLayout.VERTICAL);
scrollView.addView(layoutforWrapButtons, innerLayoutParams);
}
}
代码示例来源:origin: stackoverflow.com
hScrollView.addView(llHsMain);
代码示例来源:origin: sltpaya/XTabLayout
super.addView(mTabStrip, 0, new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
代码示例来源:origin: daquexian/chaoli-forum-for-android-2
scrollView.addView(tableLayout);
代码示例来源:origin: 296777513/pedometer
llPlat.setLayoutParams(new HorizontalScrollView.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
sv.addView(llPlat);
代码示例来源:origin: xfshipan/miappstore
hl_screen_shots.addView(screensHolder.getConvertView());
代码示例来源:origin: laizimo/richeditor
linearLayout.addView(v);
scrollView.addView(linearLayout, new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
} else {
for (MenuItem item :
代码示例来源:origin: GeoODK/collect
ll.addView(mDatePicker);
ll.setPadding(10, 10, 10, 10);
scrollView.addView(ll);
addView(scrollView);
} else {
代码示例来源:origin: GeoODK/collect
ll.addView(mDatePicker);
ll.setPadding(10, 10, 10, 10);
scrollView.addView(ll);
addView(scrollView);
} else {
内容来源于网络,如有侵权,请联系作者删除!