teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

コードを修正

2021/02/21 06:16

投稿

hodoru3sei
hodoru3sei

スコア284

title CHANGED
File without changes
body CHANGED
@@ -32,12 +32,12 @@
32
32
  ## 追記
33
33
  UpperTabListBaseViewControllerのコードです
34
34
  ```
35
- class UpperTabListBaseViewController: BaseButtonBarPagerTabStripViewController<UpperTabAnimeDayCollectionViewCell> {
35
+ class UpperTabListBaseViewController: BaseButtonBarPagerTabStripViewController<UpperTabStockDayCollectionViewCell> {
36
36
 
37
37
  required init?(coder aDecoder: NSCoder) {
38
38
  super.init(coder: aDecoder)
39
39
 
40
- buttonBarItemSpec = ButtonBarItemSpec.nibFile(nibName: "UpperTabAnimeDayCollectionViewCell", bundle: Bundle(for: UpperTabAnimeDayCollectionViewCell.self), width: { _ in
40
+ buttonBarItemSpec = ButtonBarItemSpec.nibFile(nibName: "UpperTabStockDayCollectionViewCell", bundle: Bundle(for: UpperTabStockDayCollectionViewCell), width: { _ in
41
41
  return 70
42
42
  })
43
43
  let cellHeight: CGFloat = 50
@@ -64,7 +64,7 @@
64
64
  ]
65
65
  }
66
66
 
67
- override func configure(cell: UpperTabAnimeDayCollectionViewCell, for indicatorInfo: IndicatorInfo) {
67
+ override func configure(cell: UpperTabStockDayCollectionViewCell, for indicatorInfo: IndicatorInfo) {
68
68
  cell.image.image = indicatorInfo.image?.withRenderingMode(.alwaysOriginal)
69
69
  }
70
70
 

1

コードを追加

2021/02/21 06:16

投稿

hodoru3sei
hodoru3sei

スコア284

title CHANGED
File without changes
body CHANGED
@@ -27,4 +27,47 @@
27
27
  }
28
28
  }
29
29
 
30
+ ```
31
+
32
+ ## 追記
33
+ UpperTabListBaseViewControllerのコードです
34
+ ```
35
+ class UpperTabListBaseViewController: BaseButtonBarPagerTabStripViewController<UpperTabAnimeDayCollectionViewCell> {
36
+
37
+ required init?(coder aDecoder: NSCoder) {
38
+ super.init(coder: aDecoder)
39
+
40
+ buttonBarItemSpec = ButtonBarItemSpec.nibFile(nibName: "UpperTabAnimeDayCollectionViewCell", bundle: Bundle(for: UpperTabAnimeDayCollectionViewCell.self), width: { _ in
41
+ return 70
42
+ })
43
+ let cellHeight: CGFloat = 50
44
+ let statusBarHeight = UIApplication.shared.statusBarFrame.height
45
+ settings.style.buttonBarHeight = cellHeight + statusBarHeight
46
+ settings.style.buttonBarBackgroundColor = .lightGray
47
+ }
48
+
49
+ override func viewDidLoad() {
50
+ super.viewDidLoad()
51
+
52
+ }
53
+
54
+ override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
55
+ return [
56
+ StockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "main-icon"))),
57
+ OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "monday")), dayOfTheWeek: .monday),
58
+ OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "tuesday")), dayOfTheWeek: .tuesday),
59
+ OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "wednesday")), dayOfTheWeek: .wednesday),
60
+ OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "thursday")), dayOfTheWeek: .thursday),
61
+ OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "friday")), dayOfTheWeek: .friday),
62
+ OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "saturday")), dayOfTheWeek: .saturday),
63
+ OneWeekStockListViewController(itemInfo: IndicatorInfo(image: UIImage(named: "sunday")), dayOfTheWeek: .sunday)
64
+ ]
65
+ }
66
+
67
+ override func configure(cell: UpperTabAnimeDayCollectionViewCell, for indicatorInfo: IndicatorInfo) {
68
+ cell.image.image = indicatorInfo.image?.withRenderingMode(.alwaysOriginal)
69
+ }
70
+
71
+ }
72
+
30
73
  ```