質問編集履歴
1
コードの記載
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,6 +18,108 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
+
```ここに言語を入力
|
22
|
+
|
23
|
+
- (void)viewDidLoad
|
24
|
+
|
25
|
+
{
|
26
|
+
|
27
|
+
UIBarButtonItem *favorite2 = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"star_2"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStylePlain target:self action:@selector(tappedfavorite2)];
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
UIBarButtonItem *trashButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(tappedTrash)];
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
toolbar.items = [NSArray arrayWithObjects:trashButton, flexibleSpacer, favorite2, nil];
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
- (void)tappedfavorite2
|
48
|
+
|
49
|
+
{
|
50
|
+
|
51
|
+
NSLog(@"お気に入りボタンが押された");
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height - 44, 320, 44)];
|
56
|
+
|
57
|
+
[self.view addSubview:toolbar];
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
UIBarButtonItem *favorite = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"star_1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStylePlain target:self action:@selector(tappedfavorite)];
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
UIBarButtonItem *trashButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(tappedTrash)];
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
UIBarButtonItem *flexibleSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
toolbar.items = [NSArray arrayWithObjects:trashButton, flexibleSpacer, favorite, nil];
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
- (void)tappedfavorite
|
84
|
+
|
85
|
+
{
|
86
|
+
|
87
|
+
NSLog(@"お気に入りボタンが押された");
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height - 44, 320, 44)];
|
92
|
+
|
93
|
+
[self.view addSubview:toolbar];
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
UIBarButtonItem *favorite = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"star_1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStylePlain target:self action:@selector(tappedfavorite2)];
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
UIBarButtonItem *trashButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(tappedTrash)];
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
UIBarButtonItem *flexibleSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
toolbar.items = [NSArray arrayWithObjects:trashButton, flexibleSpacer, favorite2, nil];
|
112
|
+
|
113
|
+
}
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
```
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
21
123
|
どなたかわかる方がいましたらご教授ください。
|
22
124
|
|
23
125
|
よろしくお願いします。
|