gpt4 book ai didi

iphone - 在 NSArray iOS SDK 中更改对象的 alpha 值

转载 作者:行者123 更新时间:2023-11-28 19:19:42 24 4
gpt4 key购买 nike

好吧,所以我认为这会很简单,但它让我绊倒了..我确定我只是错过了一些简单的东西,但是你们能帮帮我吗?我试图更改 nsarray 中对象 (uiimageviews) 的 alpha 值。到目前为止我得到了:

for (int i=1; i < [alphaSet count]; i++) {
[[alphaSet objectAtIndex:i] setAlpha:masterAlpha];
}

它只会抛出错误的访问...有什么想法吗?

最佳答案

使用 NSLog 确保您的 ImageView 存在。

for (int i=1; i < [alphaSet count]; i++) {
NSLog(@"At count %i there is this object: %@", i, [alphaSet objectAtIndex:i]);
UIImageView *iv = [alphaSet objectAtIndex:i];
iv.alpha = masterAlpha;
}

关于iphone - 在 NSArray iOS SDK 中更改对象的 alpha 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9959646/

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