0

Below is my code and image is visible but not the title

class PromotionScreen < PM::GroupedTableScreen
  title 'User screen'
  include ProfileImageHelpers

    def on_load
        set_nav_bar_button :left, {
                      title: 'Dev', 
                      image: user_profile_image(Auth.current_user),
                      action: :nil 
                     }

    end
end

Thanks!

Anna88
  • 345
  • 3
  • 11

1 Answers1

0

iOS provides a option to add your custom view to UINavigationBarButtonItem. Code looks like as follows in Objective-C.

 UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn setBackgroundImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
[btn addTarget:self action:@selector(btnTapped:) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];

Use the same logic in swift.

AskIOS
  • 918
  • 7
  • 19
  • Thanks @bharath, I don't have idea of objective-c, i am using rubymotion and promotion, i tried your code after converting but didn't get success. – Anna88 Mar 23 '17 at 16:00