UIImageView我想用下面的代码创建模糊效果。问题是,当我在模拟器中运行它时,我可以看到 BlurEffect,但当我连接 iPhone 时却看不到,这里我只能看到灰色背景......有什么想法吗?这是我使用的代码:
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var myImageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
self.myImageView.image = UIImage(named: "Desert.png")
let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Light)
let blurView = UIVisualEffectView(effect: blurEffect)
blurView.frame.size = CGSize(width: 375, height: 667)
blurView.center = myImageView.center
self.myImageView.addSubview(blurView)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Run Code Online (Sandbox Code Playgroud)
我正在 Xcode 6.1.1 上运行(也尝试过 Xcode 6.2!),我的 iPhone 操作系统是 8.1.2
我试图声明dictionay如下
dict = { 'key1': "A"= "value" , 'B' = "Valueb" ,
'key2': "A"= "valueA" , 'B' = "ValueC" ,
}
Run Code Online (Sandbox Code Playgroud)
我收到语法错误.任何人都可以帮我解决我做错的事吗?
我想让标题的导航有一个框阴影。然而,盒子阴影似乎被我放在它下面的旋转木马隐藏了。我把 #carousel 的所有孩子的 z-index 放在了一个 z-index 上,但是 box-shadow 仍然没有出现。
(页面片段) 
这是当我给它设置 margin-top: 40px 时按下 #carousel 时会发生什么;
(另一个页面片段) 
HTML
<header>
<nav>
<div class="container">
<h1><a href="#"><img src="images/logo.png" alt="" id="logo"></a></h1>
<h1 id="NHS"><a href="#">Newport High School</a></h1>
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Students</a></li>
<li><a href="#">Parents</a></li>
<li><a href="#">Activities & Atletics</a></li>
<li><a href="#">Resources</a></li>
</ul>
</div><!--container--->
</nav>
</header><div id="carousel">
<div class="inner">
<ul>
<li><img src="images/example-slide-1.jpg" alt="Fish"></li>
<li><img src="images/example-slide-2.jpg" alt="Elephant"></li>
<li><img src="images/example-slide-3.jpg" alt="Giraffe"></li>
<li><img src="images/example-slide-4.jpg" alt="Fish"></li>
</ul>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
/* - - - header - - - …Run Code Online (Sandbox Code Playgroud) 我在我的app委托文件中放置了以下代码.理论上,它应该从推送通知中提取消息并将其显示在UIAlertview- 但它显示标题和蜡烛按钮,而不是其他任何内容.谁能看到我错在哪里?
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
[PFPush handlePush:userInfo];
pushText = [userInfo objectForKey:@"alert"];
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:NSLocalizedString(@"News", "")
message:pushText
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles: nil];
[alert show];
}
Run Code Online (Sandbox Code Playgroud) 我用这个小小的东西读了所有的问题.FavoritosViewController.m我有:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
favcolCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"fav" forIndexPath:indexPath];
[[cell imageCell]setImage:[UIImage imageNamed:[arrayimages objectAtIndex:indexPath.item]]];
return cell;
}
Run Code Online (Sandbox Code Playgroud)
在favcolCell.h我有:
@property (retain, nonatomic) IBOutlet UIImageView *imageCell;
Run Code Online (Sandbox Code Playgroud)
在favcolCell.m我有:
@synthesize imageCell;
Run Code Online (Sandbox Code Playgroud)
(......)
- (void)dealloc {
[imageCell release];
[super dealloc];
}
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
编辑:
解决方案:做正确的课程注册.