Bonjour à tous,
Je commence sous Xcode et suis en train de faire une petite application composée majoritairement de webViews, pour débuter celle-ci, j'ai utilisé un tuto.
L'application fonctionne bien, par contre, il y a une chose que je n'arrive pas à faire, dans le menu, je souhaiterais ajouter un pictogramme avant le texte comme ceci :
Img1 Menu_1
Img2 Menu_2
Img3 Menu_3
Voici le code de la page :
Merci par avance si l'un de vous peu m'indiquer la marche à suivre.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97 #import "MasterViewController.h" #import "DetailViewController.h" @implementation MasterViewController - (void)awakeFromNib { [super awakeFromNib]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; mesFavoris = [[NSMutableArray alloc] init]; [mesFavoris addObject:@"Menu_1"]; [mesFavoris addObject:@"Menu_2"]; [mesFavoris addObject:@"Menu_3"]; self.navigationItem.title = @"Menu"; adressesWeb = [[NSMutableArray alloc] init]; [adressesWeb addObject:@"http://foo.bar"]; [adressesWeb addObject:@"http://foo.bar"]; [adressesWeb addObject:@"http://foo.bar"]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [mesFavoris count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"MyIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } // Configuration des cellules NSString *cellValue = [mesFavoris objectAtIndex:indexPath.row]; cell.textLabel.text = cellValue; return cell; } -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if([[segue identifier] isEqualToString:@"detailSegue"]) { NSInteger selectedIndex = [[self.tableView indexPathForSelectedRow] row]; DetailViewController *dvc = [segue destinationViewController]; dvc.siteSelectionne = [NSString stringWithFormat:@"%@", [adressesWeb objectAtIndex:selectedIndex]]; } } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } @end
Partager