Reputation: 355
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!
Upvotes: 0
Views: 25
Reputation: 932
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.
Upvotes: 0