質問編集履歴
2
コードを修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -66,7 +66,7 @@
|
|
66
66
|
|
67
67
|
```
|
68
68
|
|
69
|
-
class UpperTabListBaseViewController: BaseButtonBarPagerTabStripViewController<UpperTab
|
69
|
+
class UpperTabListBaseViewController: BaseButtonBarPagerTabStripViewController<UpperTabStockDayCollectionViewCell> {
|
70
70
|
|
71
71
|
|
72
72
|
|
@@ -76,7 +76,7 @@
|
|
76
76
|
|
77
77
|
|
78
78
|
|
79
|
-
buttonBarItemSpec = ButtonBarItemSpec.nibFile(nibName: "UpperTab
|
79
|
+
buttonBarItemSpec = ButtonBarItemSpec.nibFile(nibName: "UpperTabStockDayCollectionViewCell", bundle: Bundle(for: UpperTabStockDayCollectionViewCell), width: { _ in
|
80
80
|
|
81
81
|
return 70
|
82
82
|
|
@@ -130,7 +130,7 @@
|
|
130
130
|
|
131
131
|
|
132
132
|
|
133
|
-
override func configure(cell: UpperTab
|
133
|
+
override func configure(cell: UpperTabStockDayCollectionViewCell, for indicatorInfo: IndicatorInfo) {
|
134
134
|
|
135
135
|
cell.image.image = indicatorInfo.image?.withRenderingMode(.alwaysOriginal)
|
136
136
|
|
1
コードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -57,3 +57,89 @@
|
|
57
57
|
|
58
58
|
|
59
59
|
```
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
## 追記
|
64
|
+
|
65
|
+
UpperTabListBaseViewControllerのコードです
|
66
|
+
|
67
|
+
```
|
68
|
+
|
69
|
+
class UpperTabListBaseViewController: BaseButtonBarPagerTabStripViewController<UpperTabAnimeDayCollectionViewCell> {
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
required init?(coder aDecoder: NSCoder) {
|
74
|
+
|
75
|
+
super.init(coder: aDecoder)
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
buttonBarItemSpec = ButtonBarItemSpec.nibFile(nibName: "UpperTabAnimeDayCollectionViewCell", bundle: Bundle(for: UpperTabAnimeDayCollectionViewCell.self), width: { _ in
|
80
|
+
|
81
|
+
return 70
|
82
|
+
|
83
|
+
})
|
84
|
+
|
85
|
+
let cellHeight: CGFloat = 50
|
86
|
+
|
87
|
+
let statusBarHeight = UIApplication.shared.statusBarFrame.height
|
88
|
+
|
89
|
+
settings.style.buttonBarHeight = cellHeight + statusBarHeight
|
90
|
+
|
91
|
+
settings.style.buttonBarBackgroundColor = .lightGray
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
override func viewDidLoad() {
|
98
|
+
|
99
|
+
super.viewDidLoad()
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
|
108
|
+
|
109
|
+
return [
|
110
|
+
|
111
|
+
StockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "main-icon"))),
|
112
|
+
|
113
|
+
OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "monday")), dayOfTheWeek: .monday),
|
114
|
+
|
115
|
+
OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "tuesday")), dayOfTheWeek: .tuesday),
|
116
|
+
|
117
|
+
OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "wednesday")), dayOfTheWeek: .wednesday),
|
118
|
+
|
119
|
+
OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "thursday")), dayOfTheWeek: .thursday),
|
120
|
+
|
121
|
+
OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "friday")), dayOfTheWeek: .friday),
|
122
|
+
|
123
|
+
OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "saturday")), dayOfTheWeek: .saturday),
|
124
|
+
|
125
|
+
OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "sunday")), dayOfTheWeek: .sunday)
|
126
|
+
|
127
|
+
]
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
override func configure(cell: UpperTabAnimeDayCollectionViewCell, for indicatorInfo: IndicatorInfo) {
|
134
|
+
|
135
|
+
cell.image.image = indicatorInfo.image?.withRenderingMode(.alwaysOriginal)
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
}
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
```
|