热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

android.widget.FrameLayout.addView()方法的使用及代码示例

本文整理了Java中android.widget.FrameLayout.addView()方法的一些代码示例,展示了FrameLayout.addView

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

FrameLayout.addView介绍

暂无

代码示例

代码示例来源:origin: square/picasso

@Override public void setContentView(View view, ViewGroup.LayoutParams params) {
sampleContent.addView(view, params);
}
}

代码示例来源:origin: square/picasso

@Override public void setContentView(View view) {
sampleContent.addView(view);
}

代码示例来源:origin: aa112901/remusic

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.load_framelayout, container, false);
frameLayout = (FrameLayout) view.findViewById(R.id.loadframe);
View loadView = LayoutInflater.from(mContext).inflate(R.layout.loading, frameLayout, false);
frameLayout.addView(loadView);
return view;
}

代码示例来源:origin: aa112901/remusic

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.load_framelayout, container, false);
frameLayout = (FrameLayout) view.findViewById(R.id.loadframe);
View loadView = LayoutInflater.from(mContext).inflate(R.layout.loading, frameLayout, false);
frameLayout.addView(loadView);
return view;
}

代码示例来源:origin: aa112901/remusic

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.load_framelayout, container, false);
frameLayout = (FrameLayout) view.findViewById(R.id.loadframe);
loadview = LayoutInflater.from(mContext).inflate(R.layout.loading, frameLayout, false);
frameLayout.addView(loadview);
loadWords();
return view;
}

代码示例来源:origin: Flipboard/bottomsheet

/**
* Set the content view of the bottom sheet. This is the view which is shown under the sheet
* being presented. This is usually the root view of your application.
*
* @param contentView The content view of your application.
*/
public void setContentView(View contentView) {
super.addView(contentView, -1, generateDefaultLayoutParams());
super.addView(dimView, -1, generateDefaultLayoutParams());
}

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

public int measureCellWidth( Context context, View cell )
{
// We need a fake parent
FrameLayout buffer = new FrameLayout( context );
android.widget.AbsListView.LayoutParams layoutParams = new android.widget.AbsListView.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
buffer.addView( cell, layoutParams);
cell.forceLayout();
cell.measure(1000, 1000);
int width = cell.getMeasuredWidth();
buffer.removeAllViews();
return width;
}

代码示例来源:origin: nickbutcher/plaid

@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
if (sheet != null) {
throw new UnsupportedOperationException("BottomSheet must only have 1 child view");
}
sheet = child;
sheetOffsetHelper = new ViewOffsetHelper(sheet);
sheet.addOnLayoutChangeListener(sheetLayout);
// force the sheet contents to be gravity bottom. This ain't a top sheet.
((LayoutParams) params).gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
super.addView(child, index, params);
}

代码示例来源:origin: aa112901/remusic

@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
recomendAdapter = new RecommendAdapter(recommendList);
recyclerView.setAdapter(recomendAdapter);
frameLayout.removeAllViews();
frameLayout.addView(view);
}
}.execute();

代码示例来源:origin: aa112901/remusic

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.load_framelayout, container, false);
frameLayout = (FrameLayout) rootView.findViewById(R.id.loadframe);
View loadview = LayoutInflater.from(mContext).inflate(R.layout.loading, frameLayout, false);
frameLayout.addView(loadview);
if (getArguments() != null) {
key = getArguments().getString("key");
}
search(key);
return rootView;
}

代码示例来源:origin: aa112901/remusic

private void loadAllLists() {
if (NetworkUtils.isConnectInternet(this)) {
tryAgain.setVisibility(View.GONE);
loadView = LayoutInflater.from(this).inflate(R.layout.loading, loadFrameLayout, false);
loadFrameLayout.addView(loadView);
mLoadNetList = new LoadNetPlaylistInfo();
mLoadNetList.execute();
} else {
tryAgain.setVisibility(View.VISIBLE);
}
}

代码示例来源:origin: aa112901/remusic

@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
rankingAdapter.updateAdapter(items);
frameLayout.removeAllViews();
frameLayout.addView(view);
}
}.execute();

代码示例来源:origin: aa112901/remusic

private void loadAllLists() {
if (NetworkUtils.isConnectInternet(this)) {
tryAgain.setVisibility(View.GONE);
loadView = LayoutInflater.from(this).inflate(R.layout.loading, loadFrameLayout, false);
loadFrameLayout.addView(loadView);
mLoadNetList = new LoadNetPlaylistInfo();
mLoadNetList.execute();
} else {
tryAgain.setVisibility(View.VISIBLE);
}
}

代码示例来源:origin: libgdx/libgdx

Dialog createDialog () {
textView = createView(context);
textView.setOnKeyListener(this);
FrameLayout.LayoutParams textBoxLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
textView.setLayoutParams(textBoxLayoutParams);
textView.setFocusable(true);
textView.setFocusableInTouchMode(true);
textView.setImeOptions(textView.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
final FrameLayout layout = new FrameLayout(context);
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0);
layout.setLayoutParams(layoutParams);
layout.addView(textView);
layout.setOnTouchListener(this);
dialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
dialog.setContentView(layout);
return dialog;
}

代码示例来源:origin: libgdx/libgdx

Dialog createDialog () {
textView = createView(context);
textView.setOnKeyListener(this);
FrameLayout.LayoutParams textBoxLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
textView.setLayoutParams(textBoxLayoutParams);
textView.setFocusable(true);
textView.setFocusableInTouchMode(true);
textView.setImeOptions(textView.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
final FrameLayout layout = new FrameLayout(context);
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0);
layout.setLayoutParams(layoutParams);
layout.addView(textView);
layout.setOnTouchListener(this);
dialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
dialog.setContentView(layout);
return dialog;
}

代码示例来源:origin: TommyLemon/APIJSON

public void createView(BaseView bv) {
this.bv = bv;
removeAllViews();
super.addView(bv.createView(context.getLayoutInflater()));
bindView(null);
}

代码示例来源:origin: roughike/BottomBar

@Before
public void setUp() {
tabCOntainer= new FrameLayout(InstrumentationRegistry.getContext());
tab = new BottomBarTab(InstrumentationRegistry.getContext());
tabContainer.addView(tab);
}

代码示例来源:origin: AppIntro/AppIntro

private void initController() {
if (mCOntroller== null)
mCOntroller= new DotIndicatorController(this);
indicatorCOntainer= findViewById(R.id.indicator_container);
indicatorContainer.addView(mController.newInstance(this));
mController.initialize(slidesNumber);
if (selectedIndicatorColor != DEFAULT_COLOR)
mController.setSelectedIndicatorColor(selectedIndicatorColor);
if (unselectedIndicatorColor != DEFAULT_COLOR)
mController.setUnselectedIndicatorColor(unselectedIndicatorColor);
mController.selectPosition(currentlySelectedItem);
}

代码示例来源:origin: PhilJay/MPAndroidChart

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.frag_simple_bar, container, false);
// create a new chart object
chart = new BarChart(getActivity());
chart.getDescription().setEnabled(false);
chart.setOnChartGestureListener(this);
MyMarkerView mv = new MyMarkerView(getActivity(), R.layout.custom_marker_view);
mv.setChartView(chart); // For bounds control
chart.setMarker(mv);
chart.setDrawGridBackground(false);
chart.setDrawBarShadow(false);
Typeface tf = Typeface.createFromAsset(context.getAssets(), "OpenSans-Light.ttf");
chart.setData(generateBarData(1, 20000, 12));
Legend l = chart.getLegend();
l.setTypeface(tf);
YAxis leftAxis = chart.getAxisLeft();
leftAxis.setTypeface(tf);
leftAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true)
chart.getAxisRight().setEnabled(false);
XAxis xAxis = chart.getXAxis();
xAxis.setEnabled(false);
// programmatically add the chart
FrameLayout parent = v.findViewById(R.id.parentLayout);
parent.addView(chart);
return v;
}

代码示例来源:origin: facebook/litho

@Before
public void setup() {
mCOntext= new ComponentContext(RuntimeEnvironment.application);
mLithoView = new LithoView(mContext);
mParent = new FrameLayout(mContext.getAndroidContext());
mParent.setLeft(0);
mParent.setTop(0);
mParent.setRight(10);
mParent.setBottom(10);
mParent.addView(mLithoView);
}

推荐阅读
author-avatar
707282400_de0c8b
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有