本文整理了Java中android.view.View.getViewRootImpl()
方法的一些代码示例,展示了View.getViewRootImpl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.getViewRootImpl()
方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:getViewRootImpl
暂无
代码示例来源:origin: robolectric/robolectric
private ViewRootImpl getViewRoot() {
return component.getWindow().getDecorView().getViewRootImpl();
}
代码示例来源:origin: robolectric/robolectric
@Test
public void decorViewSizeEqualToDisplaySize() {
Activity activity = buildActivity(Activity.class).create().visible().get();
View decorView = activity.getWindow().getDecorView();
assertThat(decorView).isNotEqualTo(null);
ViewRootImpl root = decorView.getViewRootImpl();
assertThat(root).isNotEqualTo(null);
assertThat(decorView.getWidth()).isNotEqualTo(0);
assertThat(decorView.getHeight()).isNotEqualTo(0);
Display display = ShadowDisplay.getDefaultDisplay();
assertThat(decorView.getWidth()).isEqualTo(display.getWidth());
assertThat(decorView.getHeight()).isEqualTo(display.getHeight());
}
代码示例来源:origin: org.robolectric/shadows-framework
private ViewRootImpl getViewRoot() {
return component.getWindow().getDecorView().getViewRootImpl();
}
内容来源于网络,如有侵权,请联系作者删除!