【发布时间】:2015-09-10 02:54:49
【问题描述】:
我遇到的主要问题仅与我的代码无法在多行 3 列中显示徽章而不在每行中重复相同的徽章有关。即使我识别出 col-33,徽章仍出现在行中(以 33% 均匀间隔)超过页面的整个宽度;它们溢出页面!我尝试设置 max-width 无济于事。请,任何建议都会很棒,这里是代码:
<ion-content class="badge-bg">
<div class="row" ng-repeat="row in badgesCtrl">
<div class="col-33" ng-show="badge.images[0].url" ng-repeat="badge in badgesCtrl.badges ">
<img ng-click="badgesCtrl.viewBadgeDetail(badge)"
alt="" src="{{badge.images[0].url}}" alt="color" />
</div>
</div>
</ion-content>
控制器
.controller('BadgesCtrl', ['$location', '$routeParams', '$scope', '$state', '$ionicPopover', 'BadgesService',
function($location, $routeParams, $scope, $state, $ionicPopover, BadgesService) {
$ionicPopover.fromTemplateUrl('templates/popover.html', {
scope: $scope,
}).then(function(popover) {
$scope.popover = popover;
});
badgesCtrl = this;
$scope.search = {};
$scope.search.searchText = '';
// Initialize badges Data
BadgesService.getBadges().success(function(badges) {
badgesCtrl.badges = badges;
});
BadgesService.getBadge($routeParams.badgeId).success(function(badge){
badgesCtrl.badge = badge;
});
badgesCtrl.viewBadgeDetail = function(badge) {
$location.path('/tab/badges/' + badge._id);
};
}]);
【问题讨论】:
标签: css angularjs angular-ui-router ionic ng-repeat