How to place a UIImage in Navigationbar such that its a logo?

后端 未结 8 794
伪装坚强ぢ
伪装坚强ぢ 2020-12-22 07:30

\"enter\"enterI

8条回答
  •  渐次进展
    2020-12-22 08:31

    I had the same problem in my last project, you can create a new logo.png which dimension is equal to 500*88 pixels, make you logo in the left side of it. filled with transparent color from the rest of the png.

    UIImageView *titleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logoName_500.png"]];
    [titleImageView setFrame:CGRectMake(0, 0, 250, 44)];
    self.navigationItem.titleView = titleImageView;
    

    hope this helpful.

提交回复
热议问题