如何在离子中启用滚动?

时间:2016-03-10 05:50:15

标签: ionic-framework

我有一个登录页面。它现在已修复,但我想在我专注于任何一个文本框时启用滚动。怎么做?

 <ion-view>

<ion-content class="background">
    <div class="loginscreen">
        <div class="row">
            <div class="col-80 col-offset-10">

                <div class="appheader-frame">
                    <span>
          <img src="img/clock.png" alt="clock" class="clockwidth"></img>
        </span>
                    <h1 class="timesheettext">
          <b>Timesheet Tracking</b>
        </h1>

                </div>

            </div>

        </div>

        <div class="row">
            <div class=" formpadding col-80  col-offset-10">
                <form novalidate name="loginForm" ng-submit="doLogin(loginForm)">
                    <label class="item item-input labelusername">
                        <i class="icon  placeholder-icon"><img src="img/user.png" alt="" style="width:20px;height:20px;"/></i>
                        <input name="UserName" type="text" ng-model="User.UserName" placeholder="Username or Email" ng-focus="hidefooter()" required>
                    </label>
                    <p ng-show="loginForm.UserName.$error.required && loginSubmitted" class="usernameerror">
                        Please provide username
                    </p>
                    <label class="item item-input labelpassword">
                        <i class="icon  placeholder-icon"><img src="img/password.png" alt="" style="width:20px;height:20px;"/></i>
                        <input type="password" name="password" id="password" ng-model="User.Password" placeholder="Password" ng-focus="hidefooter()" required>
                    </label>
                    <p ng-show="loginForm.password.$error.required && loginSubmitted" class="usernameerror">
                        provide Password
                    </p>
                    <p ng-show="myflag">
                        wrong credentials
                    </p>

                    <button class="button button-block button-lightgreen" type="submit">
                        <p class="login">
                            <b>submit</b>
                        </p>
                    </button>

                </form>
            </div>
        </div>
    </div>
    <div class="bar bar-footer bar-inherit myfooter hide-on-keyboard-open">
        <div class="title">
            <p id="footer" class="byxyz" ng-show=footerflag>By xyz Software Pvt Ltd</p>
        </div>
    </div>
</ion-content>
 </ion-view>

离子骨架中有可能吗?那怎么办呢?请解释。并且不要删除页面中的任何内容,也不要添加任何细节以使其滚动。我只想在其中启用滚动但页面应该与现在相同

1 个答案:

答案 0 :(得分:2)

只需在离子内容中添加 overflow-scroll =&#34; false&#34;

  <ion-content class="background" overflow-scroll="false" >
       //code

  </ion-content>