최근에 Jelly Bean 장치에서 내 응용 프로그램을 테스트하고 내 Actionbar Dodging Code가 더 이상 작동하지 않는다는 사실을 알았습니다.Jelly Bean android.R.id.content가 변경 되었습니까?
OverlayMode가 true 인 투명 작업 표시 줄이 있지만 일부 화면에서 단단한 작업 표시 줄처럼 동작 표시 줄을 실행하려고합니다.
내가 Acionbar 높이를 확인 내가 허니 콤 갤러리 CodeBasicly에서 일부 코드를 차용 한이 작업을하고이 값에 android.R.id.content 버킷의 topMargin을 설정합니다.
public void setupActionbar() {
final int sdkVersion = Build.VERSION.SDK_INT;
int barHeight = getSupportActionBar().getHeight();
if (sdkVersion < Build.VERSION_CODES.HONEYCOMB) {
FrameLayout content = (FrameLayout) findViewById(android.R.id.content);
RelativeLayout.LayoutParams params = (android.widget.RelativeLayout.LayoutParams) content.getLayoutParams();
if (params.topMargin != barHeight) {
params.topMargin = barHeight;
content.setLayoutParams(params);
}
if (!getSupportActionBar().isShowing()) {
params.topMargin = 0;
content.setLayoutParams(params);
}
} else {
FrameLayout content = (FrameLayout) findViewById(android.R.id.content);
LayoutParams params = content.getLayoutParams();
if (params instanceof RelativeLayout.LayoutParams) {
android.widget.RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) params;
if (lp.topMargin != barHeight) {
lp.topMargin = barHeight;
content.setLayoutParams(lp);
}
if (!getActionBar().isShowing()) {
lp.topMargin = 0;
content.setLayoutParams(lp);
}
} else if (params instanceof FrameLayout.LayoutParams) {
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) params;
if (lp.topMargin != barHeight) {
lp.topMargin = barHeight;
content.setLayoutParams(params);
}
if (!getActionBar().isShowing()) {
lp.topMargin = 0;
content.setLayoutParams(params);
}
}
}
젤리에서는이 전략이 더 이상 작동하지 않습니다. Jelly Bean이 id.content 컨테이너 perhabs를 변경 했습니까?