gpt4 book ai didi

iphone - 是否可以将图像图标添加到特定 View 中的导航栏?

转载 作者:行者123 更新时间:2023-12-03 21:19:05 24 4
gpt4 key购买 nike

是否可以将图像添加到导航栏?图像只能在特定 View 中查看(即不能在整个应用程序中查看)...带有地球图标的示例:

/image/FsyH8.png

UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
imgView.image = [UIImage imageNamed: @"1.bmp"];
[self.navigationController.navigationBar addSubview:imgView];
[self.navigationController.navigationBar bringSubviewToFront:imgView];
[imgView release];

最佳答案

是的!与将任何其他 subview 添加到 View 中的方式相同。

[myNavBar addSubView: myIconView];

关于iphone - 是否可以将图像图标添加到特定 View 中的导航栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6740662/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com