FrameLayout 的子View 设置 top 值。
可以通过重写FrameLayout 的 onLayout 方法来实现。
TopContentHeight 是top的值。
@Override
protected void onLayout(boolean changed, int left, int top, int right,
int bottom) {
super.onLayout(changed, left, top, right, bottom);
if(changed) {
final int count = getChildCount();
for(int i = 0; i < count; i++) {
View child = getChildAt(i);
if(child instanceof FullScreenHandlerView) {
int width = child.getMeasuredWidth();
int height = child.getMeasuredHeight();
child.layout(0, TopContentHeight, width, TopContentHeight + height);
break;
}
}
Log.i(LOGTAG, "changed========="+changed);
}
}