1

我有一个屏幕,当我改变方向时我已经给出了方向屏幕需要一些时间来改变方向同时我得到白屏谁能告诉我为什么会发生即使我尝试使用

window.addEventListener("orientationchange", function() {
    $ionicScrollDelegate.resize(); 
  }, false);

正在运行,但我仍然遇到同样的问题。

方向改变代码:

function toggleOrientation () {
  $log.log('orientation: ', vm.orientation);
  if (vm.orientation === 'portrait') {
    vm.orientation = 'landscape';
    screen.orientation.lock('landscape');
    $log.log('TrackeventLandscape', Track.Orientation_landscape);
    Analytics.trackEvent(Track.Orientation_landscape);
  } else {
    vm.orientation = 'portrait';
    screen.orientation.lock('portrait');
    $log.log('Trackeventportrait', Track.Orientation_portrait);
    Analytics.trackEvent(Track.Orientation_portrait);
  }
}

html:

<ion-content>
  <div class="list nodata padding-15" ng-if="vm.daybooks.length === 0">
     <h4>
        <p>{{"nodatatoshow_message" | translate}}</p>
     </h4>
  </div>
  <ul class="trans-item m-t-20 m-r-10 m-l-10">
     <li ng-repeat="date in vm.uniqueDaybooks" class="FramerList list">            
        <a class="item item-icon-right dblist"> {{date}}
        <i class="icon ion-android-download" ng-click="vm.download(date)"></i>
        </a>            
        <div class="tableContainer">
          <table class="ledgerTable" cellspacing="10">
             <thead>
                <tr class="ledgerTblHeader">
                   <th>{{"user_message" | translate}}</th>
                   <th>{{"name_message" | translate}}</th>
                   <th>{{"desc_message" | translate}}</th>
                   <th>{{"income_message" | translate}}</th>
                   <th>{{"expenses_message" | translate}}</th>
                </tr>
             </thead>                 
             <tbody>
                <tr ng-repeat="daybook in vm.daybooks | filter: {date: date}" ng-click="vm.gotoDaybookDetail(daybook)">
                   <td>{{daybook.user_type === 'User' ? 'Expense' : daybook.user_type}}</td>
                   <!-- <td>{{daybook.location | limit }}</td> -->
                   <td>{{daybook.transaction_type === 'Expense' ? daybook.category : daybook.location | limit }}</td>
                   <td ng-if="daybook.transaction_type === 'FarmerTrade'">Bill-No: {{daybook.bill_no}}</td>
                   <td ng-if="daybook.transaction_type === 'Expense'">{{daybook.description | isNullExpense}}</td>
                   <td ng-if="daybook.transaction_type !== 'BuyerPayment' && daybook.transaction_type !== 'FarmerTrade' && daybook.transaction_type !== 'Expense'">{{daybook.category ? daybook.category : daybook.description | isNullAdvance}}</td>
                   <td ng-if="daybook.transaction_type === 'BuyerPayment'">{{daybook.category ? daybook.category : daybook.description | isNullPayment}}</td>
                   <td align="right">{{daybook.amount_in}}</td>
                   <td align="right">{{daybook.amount_out}}</td>
                </tr>
             </tbody>
          </table>
        </div>
     </div>
     </li>
  </ul>

4

0 回答 0