iOSアプリ開発のメモ置き場

ささたつがiOSアプリ開発で知ったObjective-Cのtipsなどを書いていく所存

テーブルビューをタブバーの下に潜り込ませる方法

translucent を設定するとタブバーを半透明にすることが出来、タブバーの下に tableView が潜りこむようになります。iOS7からはこれがデフォルトの挙動。

self.tabBarController.tabBar.alpha = 0.5;
self.tabBarController.tabBar.translucent = NO;
self.tabBarController.tabBar.backgroundColor = [UIColor greenColor];


さらに、タブバーが不透明であっても extendedLayoutIncludesOpaqueBars が YES であれば同様の挙動になる。

self.tabBarController.tabBar.translucent = YES;
tableViewController.extendedLayoutIncludesOpaqueBars = NO;