android.view.Window.addContentView()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(126)

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

Window.addContentView介绍

暂无

代码示例

代码示例来源:origin: rey5137/material

/**
 * Show this button at the specific location. If this button isn't attached to any parent view yet,
 * it will be add to activity's root view. If not, it will just update the location.
 * @param activity The activity that this button will be attached to.
 * @param x The x value of anchor point.
 * @param y The y value of anchor point.
 * @param gravity The gravity apply with this button.
 *
 * @see Gravity
 */
public void show(Activity activity, int x, int y, int gravity){
  if(getParent() == null){
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(mBackground.getIntrinsicWidth(), mBackground.getIntrinsicHeight());
    updateParams(x, y, gravity, params);
    activity.getWindow().addContentView(this, params);
  }
  else
    updateLocation(x, y, gravity);
}

代码示例来源:origin: com.actionbarsherlock/actionbarsherlock

@Override
public void addContentView(View view, LayoutParams params) {
  if (ActionBarSherlock.DEBUG) Log.d(TAG, "[addContentView] view: " + view + ", params: " + params);
  mActivity.getWindow().addContentView(view, params);
  initActionBar();
}

代码示例来源:origin: com.willowtreeapps/oak-demos

@Override
public void addContentView(View view, LayoutParams params) {
  if (DEBUG) Log.d(TAG, "[addContentView] view: " + view + ", params: " + params);
  mActivity.getWindow().addContentView(view, params);
  initActionBar();
}

相关文章

微信公众号

最新文章

更多

Window类方法