简体   繁体   English

滚动内容中的问题

[英]Scroll issues in ion content

I need to implement following functionality: 我需要实现以下功能:

<ion-content scroll="true"><div class="parent">
    <form><div class="dropdown" dropdown-select="Options"
                dropdown-model="Selected"
                dropdown-item-label="text"
                dropdown-onchange="onChange(selected)"></div>
            </div></form>
</div></ion-content>

This functionality is working fine on Android, user can scroll the whole screen also, since the form is big. 这个功能在Android上运行良好,用户也可以滚动整个屏幕,因为表格很大。 And also network dropdown is scrollable. 并且网络下拉列表也是可滚动的。 But on iOS devices network dropdown scroll is not working, user can only scroll the ion-content, but not able to scroll the dropdown options. 但是在iOS设备上,网络下拉滚动不起作用,用户只能滚动离子内容,但无法滚动下拉选项。

I tried few workarounds using $ionScrollDelegate , still no luck. 我使用$ionScrollDelegate尝试了一些变通方法,但仍然没有运气。 Any help would be much appreciated. 任何帮助将非常感激。

If you want the content to be scrollable, you need to use the ion-scroll directive again instead of ion-content. 如果希望内容可滚动,则需要再次使用离子滚动指令而不是离子内容。

Additionally, the toggle button you have is not visible when you change ion-content to ion-scroll because it is behind the sub-header. 此外,当您将离子内容更改为离子滚动时,您所具有的切换按钮不可见,因为它位于子标题后面。

Alternatively, you could use: 或者,您可以使用:

<ion-content overflow-scroll="true">
</ion-content>

Alternatively I found this HERE could help you out 或者我发现这里可以帮助你

<ion-content scroll="true">
<div class="parent">
<form>
<ion-scroll direction="y">
<div class="dropdown" dropdown-select="Options"
            dropdown-model="Selected"
            dropdown-item-label="text"
            dropdown-onchange="onChange(selected)"></div>
</div>
<ion-scroll>
</form>
</div>
</ion-content>

try to use ion-scroll directive and see if works out for you. 尝试使用ion-scroll指令,看看是否适合你。

I had the same problem, I realize that I was forcing the config to use android as platform then I got the issue. 我有同样的问题,我意识到我强迫配置使用android作为平台然后我得到了问题。 In my case the culprit was 在我的情况下,罪魁祸首是

.config(function () { ionic.Platform.setPlatform('android'); })

I remove the config and fix the problem, I can do it as this config is not needed. 我删除配置并修复问题,我可以这样做,因为不需要此配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM