在android自带的Browser里面,当网页加载完以后,titleBar会上移隐藏,想问下大家是如何实现的,如何能让他加载完成后不上移。(源代码看了n遍,但是没有找到,前来求救,谢谢大家,请大家不要推理,能给出代码实征)。
解决方案 »
- 测试题,帮帮我
- apk重新打包,相信大家都想解决这个问题
- android下能否获得本地音乐文件的pcm数据呢
- 下载过程中SD卡由于某种原因导致不可用怎么办
- insert 参数
- Android Studio 指行调试的时候报错:Target package is not specified in AndroidManifest.xml
- 切换语系成中文后 字体效果消失了!
- android wifi网络连接
- Android SQLite设计一张表,用于储存用户的笔记本信息。。
- 急需一个小型计算器的代码,有没有大神给一下
- Android系统文件夹中以下文件有什么作用?
- android如何实现远程控制PC端鼠标的——————跪求
private void showFakeTitleBar() {
if (mFakeTitleBar.getParent() == null && mActiveTabsPage == null
&& !mActivityInPause) {
WebView mainView = mTabControl.getCurrentWebView();
// if there is no current WebView, don't show the faked title bar;
if (mainView == null) {
return;
} WindowManager manager
= (WindowManager) getSystemService(Context.WINDOW_SERVICE); // Add the title bar to the window manager so it can receive touches
// while the menu is up
WindowManager.LayoutParams params
= new WindowManager.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_APPLICATION,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT);
params.gravity = Gravity.TOP;
boolean atTop = mainView.getScrollY() == 0;
params.windowAnimations = atTop ? 0 : R.style.TitleBar;
manager.addView(mFakeTitleBar, params);
}
}
------------------还有下边的 @Override
public void onOptionsMenuClosed(Menu menu) {
mOptionsMenuOpen = false;
if (!mInLoad) {
hideFakeTitleBar();
} else if (!mIconView) {
// The page is currently loading, and we are in expanded mode, so
// we were not showing the menu. Show it once again. It will be
// removed when the page finishes.
showFakeTitleBar();
}
} private void hideFakeTitleBar() {
if (mFakeTitleBar.getParent() == null) return;
WindowManager.LayoutParams params = (WindowManager.LayoutParams)
mFakeTitleBar.getLayoutParams();
WebView mainView = mTabControl.getCurrentWebView();
// Although we decided whether or not to animate based on the current
// scroll position, the scroll position may have changed since the
// fake title bar was displayed. Make sure it has the appropriate
// animation/lack thereof before removing.
params.windowAnimations = mainView != null && mainView.getScrollY() == 0
? 0 : R.style.TitleBar;
WindowManager manager
= (WindowManager) getSystemService(Context.WINDOW_SERVICE);
manager.updateViewLayout(mFakeTitleBar, params);
manager.removeView(mFakeTitleBar);
} /**
* Special method for the fake title bar to call when displaying its context
* menu, since it is in its own Window, and its parent does not show a
* context menu.
*/
/* package */ void showTitleBarContextMenu() {
if (null == mTitleBar.getParent()) {
return;
}
openContextMenu(mTitleBar);
} @Override
public void onContextMenuClosed(Menu menu) {
super.onContextMenuClosed(menu);
if (mInLoad) {
showFakeTitleBar();
}
}