Nextrek
Diff Revisions
459
vs
460
for /iOS/SafariArte/trunk/SafariArte/Controllers/PoiListVC.m
|
@@ -22,12 +22,14 @@ |
22 |
22 |
|
- (void)viewDidLoad |
23 |
23 |
|
{ |
24 |
24 |
|
[super viewDidLoad]; |
|
25 |
+ |
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"Cell"]; |
|
26 |
+ |
|
25 |
27 |
|
NSLog(@"stamapapapap"); |
26 |
|
- |
[self._collectionView setBackgroundColor:[UIColor redColor]]; |
|
28 |
+ |
|
27 |
29 |
|
|
28 |
30 |
|
self.title = NSLocalizedString(@"ListPoi", nil); |
29 |
31 |
|
|
30 |
|
- |
self._collectionView.delegate = self; |
|
32 |
+ |
self.collectionView.delegate = self; |
31 |
33 |
|
|
32 |
34 |
|
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iconLogo"]]]; |
33 |
35 |
|
|
|
@@ -35,6 +37,10 @@ |
35 |
37 |
|
|
36 |
38 |
|
} |
37 |
39 |
|
|
|
40 |
+ |
- (NSInteger)numberOfSectionsInCollectionView: (UICollectionView *)collectionView { |
|
41 |
+ |
return 1; |
|
42 |
+ |
} |
|
43 |
+ |
|
38 |
44 |
|
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section |
39 |
45 |
|
{ |
40 |
46 |
|
return 15; |
|
@@ -46,23 +52,24 @@ |
46 |
52 |
|
// The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath: |
47 |
53 |
|
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath |
48 |
54 |
|
{ |
49 |
|
- |
UICollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"cellIdentifier" forIndexPath:indexPath]; |
50 |
|
- |
|
51 |
|
- |
cell.backgroundColor=[UIColor greenColor]; |
|
55 |
+ |
PoiListCollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath]; |
|
56 |
+ |
cell.imagePoi = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"male_user"]]; |
|
57 |
+ |
cell.backgroundColor = [UIColor whiteColor]; |
|
58 |
+ |
|
52 |
59 |
|
return cell; |
53 |
60 |
|
} |
54 |
61 |
|
|
55 |
|
- |
|
|
62 |
+ |
#pragma mark – UICollectionViewDelegateFlowLayout |
56 |
63 |
|
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath |
57 |
64 |
|
{ |
58 |
65 |
|
return CGSizeMake(70, 70); |
59 |
66 |
|
} |
60 |
67 |
|
|
61 |
|
- |
- (void) collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath |
62 |
|
- |
{ |
63 |
|
- |
|
64 |
|
- |
} |
65 |
68 |
|
|
|
69 |
+ |
- (UIEdgeInsets)collectionView: |
|
70 |
+ |
(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section { |
|
71 |
+ |
return UIEdgeInsetsMake(50, 20, 50, 20); |
|
72 |
+ |
} |
66 |
73 |
|
|
67 |
74 |
|
|
68 |
75 |
|
|