将图像添加到其他视图中的按钮

发布于 2024-11-15 01:46:31 字数 283 浏览 7 评论 0原文

在我的应用程序中,我有两个视图控制器,并且两个都有表视图。两个表视图都有显示某些图像的特定按钮。现在我尝试使用 UIPopOverController 通过视图 A 将新图像设置到视图 B 中的按钮。为此我创建了B 类的对象,然后像这样完成。

[ObjB.button setImage:[UIImage imageNamed:@"1.png" forstate:UIControlStateNormal];

但我无法在按钮上获取新图像。可能的原因是什么。请帮助。任何帮助将不胜感激。

谢谢, 克里斯蒂

In my app i have two view controllers and have table view in both.Both table view have certain button showing certain images .Now i am trying to set a new image to a button in view B through view A using UIPopOverController.for this i created an object of class B and then done like this.

[ObjB.button setImage:[UIImage imageNamed:@"1.png" forstate:UIControlStateNormal];

but i am not able to get the new image on the button.What could be the possible reason.Please help.Any help will be appreciated.

Thanks,
Christy

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

又怨 2024-11-22 01:46:31

当您从 popovercontroller 转到 View B 时,请保留 B 控制器对象。

when you are going from popovercontroller to View B retain the B controllers object.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文