recruit-mp / rmpscrollingmenubarcontroller Goto Github PK
View Code? Open in Web Editor NEWRMPScrollingMenuBarController has a scrollable menu bar, and multiple view controllers.
License: MIT License
RMPScrollingMenuBarController has a scrollable menu bar, and multiple view controllers.
License: MIT License
お世話になります。初めてイシューをあげるので、お作法が間違っていたらすいません。。。
表題の件ですが、次のスクショのような問題が発生しております。
InfinitePagingモードをオフにすると問題が解消したことから、当モードに起因するのではないかと考え、イシューを立てさせていただきました。
以下がコードとなります。
class AppDelegate: UIResponder, UIApplicationDelegate, RMPScrollingMenuBarControllerDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// 中略
self.setup()
return true
}
func setup() {
// 画面初期化
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
// RMPScrollingMenuBarの初期化
var menuController:RMPScrollingMenuBarController = RMPScrollingMenuBarController()
menuController.delegate = self
// メニューバーのカスタム設定項目
menuController.view.backgroundColor = UIColor.whiteColor()
menuController.menuBar.indicatorColor = UIColor.blueColor()
menuController.menuBar.style = RMPScrollingMenuBarStyle.InfinitePaging
menuController.menuBar.showsIndicator = true
menuController.menuBar.showsSeparatorLine = true
// タブ化したいviewControllerのインスタンス化
// 参考:http://qiita.com/midori004/items/4a67dc70af582aa91eec
var storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc1 = storyboard.instantiateViewControllerWithIdentifier("ArticleTableView") as! ArticleTableViewController
let vc2 = storyboard.instantiateViewControllerWithIdentifier("selectMediaTable") as! MediaManageTableViewController
let vc3 = storyboard.instantiateViewControllerWithIdentifier("config") as! UITableViewController
// タブ化したいVCの配列
let viewControllers = NSArray(array: [vc1, vc1, vc1, vc2, vc3])
// メニューバーにVCの配列をセット
menuController.setViewControllers(viewControllers as [AnyObject], animated: true)
// NavigationControllerを作成しセット
var naviController:UINavigationController
naviController = UINavigationController(rootViewController: menuController)
self.window?.rootViewController = naviController
self.window?.makeKeyAndVisible()
}
let titleItem : [String] = [ "タイトル1ほげ", "2番目のタイトル", "No3", "4枚目", "タイトル5"]
// RMPScrollingMenuBar メニューバー設定
func menuBarController(menuBarController: RMPScrollingMenuBarController!, menuBarItemAtIndex index: Int) -> RMPScrollingMenuBarItem! {
var item = RMPScrollingMenuBarItem()
item.title = titleItem[index]
var button = item.button()
button.setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
button.setTitleColor(UIColor.grayColor(), forState: UIControlState.Disabled)
button.setTitleColor(UIColor.blueColor(), forState: UIControlState.Selected)
return item
}
}
以上、報告申し上げます。
Nullability annotations should be added so Swift developers don't have to deal with implicitly unwrapped optionals when integrating this pod.
For customizing design of menu bar, Want to be able to hide the indicator and the bottom separator line.
You have a retain cycle in your component. Transition context retains animator where animator retains context.
I used RMPScrollingMenuBarController to build my page
I added a BarButtonItem to the navigationbar but, This BarButtonItem can be seen, but when I click on it, it can't work.
Anyone who can help me?
I already asked this question on the blog, but I thought it might be better to do so here.
I would like to change tab titles triggered by a user action. Is it possible? I put a delegate method on the target class as below, but I do know how to call this method. I tried calling menuController.setViewControllers(viewControllers, animated: false)
but it did not work. I would appreciate your advice!
func menuBarController(menuBarController: RMPScrollingMenuBarController!, menuBarItemAtIndex index: Int) -> RMPScrollingMenuBarItem! {
let item = RMPScrollingMenuBarItem ()
item.title = "test"
return item
}
Crash in case which called setViewController at the second time in order to change menuBarController's viewControllers.
NSArray* viewControllersFirst = @[vc1a, vc2a, vc3a];
[menuBarController setViewControllers:viewControllers];
...
// Already shows viewControllers in menuBarController
...
// In certain timing, reset viewControllsers
NSArray* viewControllersSecond = @[vc1b, vc2b, vc3b];
[menuBarController setViewControllers:viewControllers]
// Crash!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.