我添加了具有允许缩放/缩放的属性的视口.我将这些添加到本机代码中:
WebSettings settings = super.appView.getSettings(); settings.setBuiltInZoomControls(true); settings.setDisplayZoomControls(true); settings.setSupportZoom(true);
我可以缩放,但随着我的观点,离子标题栏和离子导航栏变焦.我尝试给标头css,以保持它固定:
position: fixed; top: 0px; left: 0px;
但是,它仍然会变焦.
我的index.html有一个ion-header-bar,它包含一个图像.
模板进入
<ion-nav-view class="has-header"></ion-nav-view>
我需要放大特定div的模板是’离子视图’,它看起来像:
<ion-view> <ion-nav-bar class="bar-stable"> <ion-nav-buttons side="right"> icon1 </ion-nav-buttons> <ion-nav-buttons side="left"> icon2 </ion-nav-buttons> </ion-nav-bar> <div> Multiple divs in here,which are containers for html and css data we receive via AJAX requests. And this is here I need zooming in. </div> </ion-view>
解决方法
我想获得类似的功能,并能够使用
ion-scroll使其工作.
<ion-scroll zooming="true" direction="xy" style="width: 100%; "> <div></div> </ion-scroll>