uinavigationcontroller に埋め込まれている uiviewcontroller に次のコードがあります。
ビューでDidLoad:
[self addLogo];
下:
- (void) addLogo
{
UIImage *image = [UIImage imageNamed:@"logoblack.png"];
UIImageView *myImageView = [[UIImageView alloc] initWithImage:image];
myImageView.frame = CGRectMake(0, 0, 30, 30);
myImageView.layer.cornerRadius = 5.0;
myImageView.layer.masksToBounds = YES;
myImageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
myImageView.layer.borderWidth = 0.1;
self.navigationItem.titleView = myImageView;
}
私が持っている画像は 434 x 434 ですが、30 x 30 にしたいのです。スケール方法はありますか?