gpt4 book ai didi

ios - 如何在 iPhone 的自定义按钮上设置事件指示器

转载 作者:可可西里 更新时间:2023-11-01 03:27:33 25 4
gpt4 key购买 nike

我是 iPhone 开发新手。我想设置一个加载到我的自定义按钮上的事件指示器。请指导我。 (示例:应用商店 --> 搜索 --> 再显示 25 个(点击))。

最佳答案

添加 UIActivityIndi​​catorView 作为按钮的 subview :

// Create spinner
UIActivityIndicatorView *myIndicator = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];

// Position the spinner
[myIndicator setCenter:CGPointMake(myButton.frame.size.width / 2, myButton.frame.size.height / 2)];

// Add to button
[myButton addSubview:myIndicator];

// Start the animation
[myIndicator startAnimating];

关于ios - 如何在 iPhone 的自定义按钮上设置事件指示器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2469184/

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