我进行了一次robolectric测试:
@Rule
public final ActivityScenarioRule<AppCompatActivity> activityScenarioRule =
new ActivityScenarioRule<>(AppCompatActivity.class);
@Before
public void setUp() {
View myView = createView();
activityScenarioRule
.getScenario()
.onActivity(activity -> activity.setContentView(standAloneSupportSuperG));
headerHeight = myView.getHeaderView().getHeight();
}
运行测试,但是当我调试视图的高度headerHeight == 0
时。
我想念什么?