Android的PhoneGap的插件,用户界面的TabBar,调整的WebView [英] Android PhoneGap Plugin, UI tabbar, resize WebView
问题描述
我创建一个美味的PhoneGap插件,希望能开辟一旦 准备好了.. 该插件基本完成,我只是需要一个漂亮的UI用户 互动。
I am creating a tasty PhoneGap plugin that hopefully will be opened up once it is ready.. The plugin is mostly finished, I just need a nice UI for user interaction.
在简单地说,我想创建一个原生的Android工具栏的组成部分。 大部分你会如何,如果你实现了PhoneGap的UIControls的TabBar 库IOS由无咖啡因忍者软件。
In a nutshell I want to create a "native" android toolbar component. Much how you would if you implement the PhoneGap UIControls Tabbar library for IOS by Decaf Ninja Software.
在理想情况下;
- 在工具栏应通过PhoneGap的秀和隐藏之称从JavaScript。
- 在这些调用web视图appView调整大小的工具栏显示/从屏幕 的底部消失的
- The toolbar should be called from JavaScript through PhoneGap to "show" and "hide".
- On these calls the WebView appView is resized as the toolbar appears / disappears from the bottom of the screen.
我可以调整上推出的appView;
I can resize the appView on launch with;
super.init();
//re-configure appView layout
super.appView.setLayoutParams(new LinearLayout.LayoutParams(width,
height));
但我不知道这是正确的做法,而且,我该怎么办 这在运行时? (web视图应在程序开始时FILL_PARENT) 我想我不能使用XML纸张改变布局中旬 运行时。 在PhoneGap的库处理所有布局编程,所以我 也许应该离开XML出来。
But I am not sure if this is the right approach, also, how can I do this in runtime? (the webview should be fill_parent at app start) I assume I cannot use XML sheets for changing the layout in mid- runtime. The PhoneGap library handles all the layout programmatically so I should probably leave XML out of it.
另外,作为appView被保护是非常困难与打 这一点,除非我不延长DroidGap在我的活动:(
Also as the appView is protected it is very difficult to play with this unless I am not extending DroidGap in my activity :(
DroidGap.class
DroidGap.class
/* 184 */ this.root = new LinearLayoutSoftKeyboardDetect(this, width, height);
/* 185 */ this.root.setOrientation(1);
/* 186 */ this.root.setBackgroundColor(-16777216);
/* 187 */ this.root.setLayoutParams(new LinearLayout.LayoutParams(-1, -1, 0.0F));
那么,
/* 208 */ this.appView = new WebView(this);
/* 209 */ this.appView.setId(100);
/* 211 */ this.appView.setLayoutParams(new LinearLayout.LayoutParams(-1, -1, 1.0F));
和
/* 249 */ bindBrowser(this.appView);
/* */
/* 252 */ this.appView.setVisibility(4);
/* 253 */ this.root.addView(this.appView);
/* 254 */ setContentView(this.root);
任何想法??
Any Ideas??
我认为这将是谁想要落实的PhoneGap的的WebView ~~~~
I think this would be useful for anyone who wants to implement native UI controls on top of PhoneGap's webview~~~~
的* 修改
* EDIT
我能够强迫相对布局到的WebView appView的父母使我能够增加其他相关要素,我可以再控制调整...
I was able to force a relative layout to the parent of the WebView appView which enabled me to add other relative elements which I can then control the alignment...
使用; - (的onCreate)
with;- (onCreate)
// Initiate appView
super.init();
setContentView(R.layout.main);
// Re-configure appView layout by adding a RelativeLayout between root view and appView
RelativeLayout view = (RelativeLayout)findViewById(R.id.phonegap_container);
html = (View)super.appView.getParent();
html.setBackgroundColor(Color.RED);
view.addView(html, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
我仍然在寻找关于动画的appView涨一些帮助,当我的导航栏从下向上的动画......
I am still looking for some help on animating the appView "up" when my nav bar animates up from the bottom......
推荐答案
你为什么不建立在你正在使用的应用程序,它可以模仿滑块一个div?
Why don't you create a div in the app you are using, which can imitate a slider?
http://www.webresourcesdepot.com/sliding-top-menu -with-的jQuery /
或者是有一个理由让你本地办呢?
Or is there a reason for you to do it natively ?
这篇关于Android的PhoneGap的插件,用户界面的TabBar,调整的WebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!