Giter Site home page Giter Site logo

rmpscrollingmenubarcontroller's Issues

Change tab titles triggered by a user action

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
}

Space between menu items is not same

Hi,

I had changed menu items text with different names. I found that based on text size the difference between the items is not same.

Here i attached screens please find out.
image

Retain cycle

You have a retain cycle in your component. Transition context retains animator where animator retains context.

InfinitePagingモード時に、インディケーターがずれてしまいます

お世話になります。初めてイシューをあげるので、お作法が間違っていたらすいません。。。

表題の件ですが、次のスクショのような問題が発生しております。

ios simulator screen shot 2015 08 17 20 51 31

InfinitePagingモードをオフにすると問題が解消したことから、当モードに起因するのではないかと考え、イシューを立てさせていただきました。

以下がコードとなります。

  • Swift 1.2
  • Xcode 6.4
  • iOS 8.4
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
    }
}

以上、報告申し上げます。

Crash in case which call serViewControllers at the second time.

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!!

Add Nullability annotations

Nullability annotations should be added so Swift developers don't have to deal with implicitly unwrapped optionals when integrating this pod.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.