android.widget.HorizontalScrollView.setLayoutParams()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中android.widget.HorizontalScrollView.setLayoutParams()方法的一些代码示例,展示了HorizontalScrollView.setLayoutParams()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HorizontalScrollView.setLayoutParams()方法的具体详情如下:
包路径:android.widget.HorizontalScrollView
类名称:HorizontalScrollView
方法名:setLayoutParams

HorizontalScrollView.setLayoutParams介绍

暂无

代码示例

代码示例来源: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: 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: stackoverflow.com

// Fix the size of the HorizontalScrollView so it doesn't expand
HorizontalScrollView hsv = (HorizontalScrollView) getDialog().findViewById(R.id.grid_kanji_root);

int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, (float) hsv.getHeight(), getResources().getDisplayMetrics());
int width = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, (float) hsv.getWidth(), getResources().getDisplayMetrics());
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(width, height);

hsv.setLayoutParams(lp);

代码示例来源: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

LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpSv.setMargins(dp_9, dp_9, dp_9, dp_9);
sv.setLayoutParams(lpSv);
llToolBar.addView(sv);

代码示例来源:origin: stackoverflow.com

hScrollView.setLayoutParams(new LayoutParams(scrWidth,
    LayoutParams.WRAP_CONTENT));

代码示例来源:origin: MyScript/interactive-ink-examples-android

scrollView.setLayoutParams(scrollViewLayoutParams);

代码示例来源:origin: daquexian/chaoli-forum-for-android-2

scrollView.setLayoutParams(svParams);

代码示例来源:origin: 296777513/pedometer

LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpSv.setMargins(dp_9, dp_9, dp_9, dp_9);
sv.setLayoutParams(lpSv);
llToolBar.addView(sv);

相关文章

HorizontalScrollView类方法