can't display custom BarButton on toolbar

sunlite sunlite 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
I used the following codes to the ZBar Reader Sample source code, then create a libzbar.a and added to my iOS App.But can't display custom BarButton on toolbar. Please help. thanks!

`ZBarReaderViewController.h

@interface ZBarReaderViewController: UIViewController
{IBOutlet UIButton *PowerButton;}

@property (nonatomic, assign) IBOutlet UIButton *PowerButton;

ZBarReaderViewController.m

@synthesize PowerButton;

CGRect frame1 = CGRectMake(150.0, 435.0, 50.0, 10.0);
PowerButton = [[UIButton alloc] initWithFrame:frame1];
UIImage *chatImage = [UIImage imageNamed:@"PowerButtonOn.png"];
PowerButton = [UIButton buttonWithType:UIButtonTypeCustom];
[PowerButton setImage:[UIImage imageNamed:@"PowerButtonOn.png"] forState:UIControlStateNormal];
[PowerButton setImage:[UIImage imageNamed:@"PowerButtonOff.png"] forState:UIControlStateSelected];
[PowerButton setBackgroundImage:chatImage forState:UIControlStateNormal];
[PowerButton addTarget:self action:@selector(PowerButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
toolbar.items =[NSArray arrayWithObjects:[[[UIBarButtonItem alloc]
initWithBarButtonSystemItem: UIBarButtonSystemItemCancel
target: self
action: @selector(cancel)]
autorelease],
[[[UIBarButtonItem alloc]
initWithBarButtonSystemItem: UIBarButtonSystemItemFlexibleSpace
target: nil
action: nil]
autorelease],
[[[UIBarButtonItem alloc] initWithCustomView:PowerButton] autorelease],
[[[UIBarButtonItem alloc]
initWithBarButtonSystemItem: UIBarButtonSystemItemFlexibleSpace
target: nil
action: nil]
autorelease], nil];
[controls addSubview: toolbar];
[toolbar release];
[view addSubview: controls];`
...全文

相关推荐

神经网络自校正PID控制器自适应PID研究(Matlab代码实现)

内容概要:本文系统研究了神经网络自校正PID控制器在自适应控制中的应用,重点通过Matlab代码实现了该控制器的设计与仿真,并将其应用于永磁同步电机(PMSM)等复杂非线性系统的速度控制中。文章详细对比了该方法与传统PID控制、滑模控制的性能差异,验证了其在动态响应精度、鲁棒性及自适应调节能力方面的显著优势。资源包还提供了丰富的Simulink仿真模型,涵盖无位置传感器控制、高频注入法、负载转矩估计、滑模观测器、谐波抑制、弱磁控制等多种先进电机控制策略,构建了一个面向高性能电机驱动的综合算法研究平台。; 适合人群:具备自动控制理论基础和Matlab/Simulink仿真能力的研究生、科研人员,以及从事电机控制、智能控制算法开发的工程技术人员。; 使用场景及目标:①深入掌握神经网络与PID融合的自校正机制及其在非线性系统中的自适应调控原理;②开展PMSM先进控制策略(如无感控制、滑模观测、负载估计)的建模仿真与性能对比分析;③支撑科研项目验证、学术论文复现或毕业课题的技术实现与创新拓展。; 阅读建议:建议结合所提供的Matlab代码与Simulink模型进行动手实践,重点关注控制器结构设计、参数整定过程及仿真结果分析,同时参考配套文献以深化对控制理论和工程应用背景的理解,从而实现从理论到仿真的完整闭环学习与创新能力提升。

@橘柑橙柠桔柚

usecase.svg

usecase.svg

2601_97257382

x86 16位微处理器 8086的逻辑结构图

x86 16位微处理器 8086的逻辑结构图

iltrrain

md-20261204(fr1122).zip

md-20261204(fr1122).zip

chuchu00000000

【低温物理实验】基于闭循环制冷机的77K量子教学平台设计:高校超导与量子器件实验系统构建

内容概要:本文详细介绍了77K低温量子教学实验平台的设计方案,采用闭循环制冷机替代传统液氮杜瓦,旨在解决教学场景中液氮使用存在的窒息风险、频繁预冷耗时及移动受限等问题。平台基于国产单级GM冷头构建,具备77~120 K连续控温能力,集成真空恒温器、测控系统、安全联锁与教学功能模块,支持迈斯纳效应、超导转变测量、约瑟夫森结等八大实验项目。通过热负载计算、振动抑制、远程监控与一键演示模式设计,确保系统安全、稳定、易用,并满足高校本科教学对开放实验室、学生自主操作的需求。; 适合人群:高等院校物理、电子、材料等相关专业的本科生与研究生,以及从事低温量子实验教学的教师与实验室技术人员。; 使用场景及目标:①开展超导物理、低温电子学、量子器件表征等课程实验教学;②支持学生在课后自主时段进行重复实验与探究式学习;③实现零日常操作、连续运行的开放实验室管理模式;④为后续科研级低温系统建设提供技术验证与人才培养基础。; 阅读建议:本文档兼具工程设计与教学应用指导价值,建议使用者重点研读系统总体架构、安全设计、教学功能实现及操作规程部分,结合附录中的实验项目卡与SOP草案,全面掌握平台的运行逻辑与教学适配方法。在实际部署前,需逐一确认压缩机房、供电、楼板承载等外部条件,并严格执行验收大纲。

Allen_Lyb
评论
收藏 已收藏
分享
返回顶部
sunlite
iOS 29,037 成员 12,459 内容