Reputation: 3
UIView *sLineBarView = [[UIView alloc]initWithFrame:CGRectMake(0,0,1,20)];
[sCustomTitleView addSubview:sLineBarView];
[sLineBarView TUMMoveToVerticalCenter];
[sLineBarView release];
UIImage *sDropBoxImg= [UIImage imageNamed:@"bt_dropdown"];
UIImageView *sDropDownBox = [[UIImageView alloc] initWithImage: sDropBoxImg];
[sDropDownBox setFrame: CGRectMake(0,30, 92, 58)];
[sDropDownBox setAlpha:1.0f];
sDropDownBox.userInteractionEnabled = YES;
sDropDownBox.tag = kDropBoxTag;
[sCustomTitleView addSubview:sDropDownBox];
[sDropDownBox release];
UIImage *sRightImage1 = [UIImage imageNamed:@"gnb_bt_menu"];
UIButton *sCustomBarItem0 = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 20,40)];
[sCustomBarItem0 setBackgroundImage:sRightImage1 forState:UIControlStateNormal];
[sCustomTitleView addSubview:sCustomBarItem0];
[sCustomBarItem0 TUMMoveToVerticalCenter];
sViewController.navigationItem.titleView = sCustomTitleView;
I want to navigationBar titleView alignment left but with no success.
How to make navigationBar titleView align left?
fream.x = negative
In my opinion, this is imprecise.(because ios version)
Upvotes: 0
Views: 478
Reputation: 1778
Increase sCustomTitleView
width and check or you can try this code in viewDidLoad
-
UILabel* lbl = [[UILabel alloc] initWithFrame:CGRectMake(0,0,200,40)];
lbl.textAlignment = NSTextAlignmentLeft;
lbl.text = @"My Title";
self.navigationItem.titleView = lbl;
Upvotes: 1