我正在努力解决问题.我正在捕捉一个视频,我把UIImageView和UIImage放在其中作为UIImagePicker CameraOverLay.因此,当用户启动相机以捕获视频时,他可以在相机上看到叠加.当用户停止捕获并且正在移动到UIImagePicker的"取消或重新启动"屏幕时,cameraOverlayView仍然可见.
有关如何在"重拍或取消"屏幕中不显示叠加层的任何想法?
我在我的一个应用程序UICollectionView中使用,具有自定义单元格但具有默认流程.目前,该视图连续显示3个单元格(所有单元格大小相同).单元格从左到右填充行,但我需要从右到左.
可能吗?我是否需要创建自定义流程布局?如果是这样,任何人都可以举个简单的例子?
任何帮助将不胜感激.
iphone objective-c ios uicollectionview uicollectionviewlayout
我正在尝试在UIScrollView内的UIView上创建一个Parallax效果.效果似乎有效,但不太好.
然后我在scrollViewDidScroll中实现了以下内容:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat offsetY = scrollView.contentOffset.y;
CGFloat percentage = offsetY / scrollView.contentSize.height;
NSLog(@"percent = %f", percentage);
if (offsetY < 0) {
firstView.center = CGPointMake(firstView.center.x, firstView.center.y - percentage * 10);
} else if (offsetY > 0){
firstView.center = CGPointMake(firstView.center.x, firstView.center.y + percentage * 10);
}
}
Run Code Online (Sandbox Code Playgroud)这些代码行确实产生了视差效果,但是当滚动继续时,如果我滚动到原始起始位置,视图不会返回到它的原始位置.
我试过操纵视图图层和框架,都具有相同的结果.
任何帮助都感激不尽.
我用a UIPickerView来显示随机数.用户可以按下按钮,从而触发随机选择内部的数字UIPickerView.
UIPickerView当我调用方法时,在里面显示多少个对象或数字并不重要:
[self.picker selectRow:randomRow inComponent:0 animated:YES];
Run Code Online (Sandbox Code Playgroud)
它始终以相同的时间间隔进行动画处理.
是否有任何选项或方法可以延长上述方法的动画时间间隔?
我试过把它放在一个动画块中:
[UIView beginAnimations:@"identifier" context:nil];
// code
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)
但这似乎是一个死胡同.
我也尝试在完成块中执行它:
// 0.34f is the approximate defualt apple animation
[UIView animateWithDuration:0.34f animations:^{
[self.picker selectRow:randomRow inComponent:0 animated:YES];
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.34f animations:^{
[self.picker selectRow:randomRow inComponent:0 animated:YES];
} completion:nil];
}];
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激.
我有分类UICollectionViewFlowLayout,在那个子类中,我正在改变UICollectionViewLayoutAttributes帧,以便它们看起来更大或更小 - 取决于它们在屏幕上的位置.
我正在执行框架更改layoutAttributesForElementsInRect:并将其返回layoutAttributesForItemAtIndexPath:我将返回YES shouldInvalidateLayoutForBoundsChange:
一切都运行良好,但细胞不会动画帧的变化.
我错过了什么吗?为什么这些变化没有动画?
谢谢.
animation ios uicollectionview uicollectionviewcell uicollectionviewlayout
我有一个使用自动布局的应用程序.
当用户选择他或她的设备手机语言时,该应用程序可以完美地切换RTL和LTR语言.所有文本都已本地化,语言指示正常.
我在应用程序中也有一个按钮,可以在不重新启动应用程序的情况下更改其语言.这也很有效,所有文本都被替换.
问题在于,当用户从应用程序中更改语言时,我预先定义的约束中的"尊重语言方向"选项具有讽刺意味的是不受尊重.
有任何想法吗?
我在Xcode 6调试器中看到了一个奇怪的行为.我使用以下代码创建了一个单例共享实例:
+ (instancetype)shared
{
static DataBaseManager *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[DataBaseManager alloc] init];
});
return sharedInstance;
}
Run Code Online (Sandbox Code Playgroud)
通过调用这样的方法初始化对象之后:
DataBaseManager *manager = [DataBaseManager shared];
NSLog(@"");
Run Code Online (Sandbox Code Playgroud)
我在"NSLog"上放置了一个断点,我看到了以下调试器状态:
我已经确定我正在启动调试模式,并且构建设置很好,遵循这里的问题:Xcode调试器不打印对象并显示nil,当它们不是
有关为什么会发生这种情况的任何想法?这是我第一次见到这种奇怪的行为.任何帮助将非常感激.
**UPDATE**
A bug was reported to apple bug report system.
The bug status is: Duplicate of 17164538 (Closed)
so it is probably a known bug in Xcode.
Run Code Online (Sandbox Code Playgroud) 我在Xcode6 Beta上玩Swift,当我在func定义'#'中使用时,就像在Apple的Swift编程指南中一样,我得到以下编译器错误:
参数中的无关'#':'characterToFind'已经是关键字参数名称
// this code is a copy-paste code from apple's Swift language programing guide
func containsCharacter(#string: String, #characterToFind: Character) -> Bool {
for character in string {
if character == characterToFind {
return true
}
}
return false
}
Run Code Online (Sandbox Code Playgroud)
它只是新Xcode的一个错误吗?
ios ×8
objective-c ×3
animation ×2
autolayout ×1
debugging ×1
ios7 ×1
iphone ×1
parallax ×1
swift ×1
uipickerview ×1
uiscrollview ×1
uiview ×1
xcode ×1
xcode6 ×1