我的要求是创建一个具有固定标题和第一列的表格,表格数据将在水平和垂直方向上滚动.
两个正文滚动视图的滚动值在onScroll事件中使用refs放在另外两个scrollview的scrollTo中,scrollEventThrottle值为16.
我的问题是如何同步这些滚动视图滚动,因为这清楚地显示滞后,这是不可接受的
以下代码
NSArray *colors = [[NSArray alloc]init];
if ([CONDITION]) {
colors = @[
[UIColor colorWithRed:240/255.f green:159/255.f blue:254/255.f alpha:1],
[UIColor colorWithRed:255/255.f green:137/255.f blue:167/255.f alpha:1],
[UIColor colorWithRed:126/255.f green:242/255.f blue:195/255.f alpha:1],
[UIColor colorWithRed:119/255.f green:152/255.f blue:255/255.f alpha:1],
[UIColor colorWithRed:240/255.f green:159/255.f blue:254/255.f alpha:1],
];
} else {
colors = @[
[UIColor colorWithRed:240/255.f green:159/255.f blue:254/255.f alpha:1],
[UIColor colorWithRed:255/255.f green:137/255.f blue:167/255.f alpha:1],
[UIColor colorWithRed:126/255.f green:242/255.f blue:195/255.f alpha:1],
[UIColor colorWithRed:119/255.f green:152/255.f blue:255/255.f alpha:1],
];
}
Run Code Online (Sandbox Code Playgroud)
这段代码执行得很完美但是在内存分析期间,我在静态分析器中遇到错误"Dead Store""在初始化过程中存储到'colors'的值永远不会被读取",我不知道我怎么能执行这段代码.
我有一个NSMutableDictionary内部另一个,NSMutableDictionary我应该如何在内部设置一个值NSMutableDictionary,我已经尝试过
[[PUser setObject:self.name forKey:@"profile"][@"name"];
Run Code Online (Sandbox Code Playgroud)
但它给出了下标需要接口“NSString”的大小,这与此架构和平台错误不一致,有什么建议吗?
我似乎无法使用角度的ngDialog.这是我的代码
discountModal函数
$scope.discountModalOpen = function () {
ngDialog.open({
template: 'views/discountModal.html',
controller: 'ModalInstanceCtrl',
scope: $scope
});
};
Run Code Online (Sandbox Code Playgroud)
discountModal的控制器
angular.module('myApp')
.controller('myProductsCtrl',
['$scope', '$stateParams', 'productService', '$modal','ngDialog', '$filter','$location',
function ($scope, $stateParams, productService, $modal, $filter,ngDialog, $location) {
});
Run Code Online (Sandbox Code Playgroud)
app.js
angular
.module('myApp', [
'ngAnimate',
'ngCookies',
'ngResource',
'ngSanitize',
'ngTouch',
'restangular',
'ui.router',
'ui.bootstrap',
'angularMoment',
'timer',
'ngMessages',
'ngDialog'
])
Run Code Online (Sandbox Code Playgroud)
我的javascript控制台中仍然出现以下错误
TypeError:ngDialog.open不是Scope的函数.$ scope.discountModalOpen(http:// localhost:9000/scripts/controllers/myProductsCtrl.js:293:18)at fn(eval at(http:// localhost:9000) /bower_components/angular/angular.js:13231:15),:4:242)在http:// localhost:9000/bower_components/angular-touch/angular-touch.js:478:9 在Scope.$ get.Scope .$ eval(http:// localhost:9000/bower_components/angular/angular.js:15916:28)在Scope.$ get.Scope.$ apply(http:// localhost:9000/bower_components/angular/angular.js) :16016:25)在HTMLButtonElement.(http:// localhost:9000/bower_components/angular-touch/angular-touch.js:477:13)HTMLButtonElement.jQuery.event.dispatch( …
ios ×2
iphone ×2
objective-c ×2
angularjs ×1
datatable ×1
javascript ×1
ng-dialog ×1
react-native ×1
scrollview ×1