gpt4 book ai didi

ios - iOS 中的工具提示通过 native UI 控件?

转载 作者:可可西里 更新时间:2023-11-01 05:04:42 26 4
gpt4 key购买 nike

如何在不使用任何第三方类的情况下在 iOS 中创建工具提示或类似内容?我有一个 UIButton,我希望弹出工具提示几秒钟或直到它被清除。我看过第三方类和库,但想知道它是否受本地支持。我还想显示一个从工具提示来源处弹出的箭头。我见过一些 UIActionSheet 弹出窗口有这个箭头。

干杯,阿米特

最佳答案

好吧,我最终使用了第三方工具提示 CMTopTipView毕竟。它的开销相对较低,只是一个 header 和实现。稍微修改它以说明 ARC。这是我所做的:

#import "CMPopTipView.h"

CMPopTipView *navBarLeftButtonPopTipView;

- (void) dismissToolTip
{
[navBarLeftButtonPopTipView dismissAnimated:YES];
}

- (void) showDoubleTap
{
navBarLeftButtonPopTipView = [[CMPopTipView alloc]
initWithMessage:@"DOUBLE Tap \n to view details"] ;
navBarLeftButtonPopTipView.delegate = self;
navBarLeftButtonPopTipView.backgroundColor = [UIColor darkGrayColor];
navBarLeftButtonPopTipView.textColor = [UIColor lightTextColor];
navBarLeftButtonPopTipView.opaque = FALSE;
[navBarLeftButtonPopTipView presentPointingAtView:catButton1
inView:self.view animated:YES];
navBarLeftButtonPopTipView.alpha = 0.75f;

NSTimer *timerShowToolTip = [NSTimer scheduledTimerWithTimeInterval:5.0
target:self
selector:@selector(dismissToolTip) userInfo:nil repeats:NO];

}

关于ios - iOS 中的工具提示通过 native UI 控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14243734/

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