草庐IT

scroll-view滚动条

全部标签

ios - 在菜单 View 中对项目进行排序后丢失的项目

UIActivity函数有问题。首先,我创建了3个事件项目:activityDownloadactivityTrashactivityMove。并添加到UIActivityViewController然后,当我呈现UIActivityViewController时,其中包括上面的3个项目。好的,这里没问题。然后,当我单击“更多”按钮并对项目进行排序时,例如,我将“移动”按钮移到顶部,单击“完成”按钮后,我不知道为什么下载,垃圾邮件丢失了?移动项目仅显示在AirDrop菜单View中。NSURL*url=[selffileToURL:self.documentName];NSArray*

ios - supportedInterfaceOrientationsForWindow 返回 UIInterfaceOrientationMaskPortrait 但我的 View Controller 显示为横向

我正在处理appdelegate.m文件中的所有方向。supportedInterfaceOrientationsForWindow为我的一些ViewController返回UIInterfaceOrientationMaskLandscape,为一个ViewController返回UIInterfaceOrientationMaskPortrait。当我从横向ViewController移动到纵向ViewController时,我想supportedInterfaceOrientationsForWindow返回UIInterfaceOrientationMaskPortrait但我

ios - 如何在委托(delegate)中加载插页式广告并在另一个 View Controller 中显示?

我试图在应用程序启动后立即请求Admob插页式广告,因此我尝试在appDelegate.m中实现,但是当我稍后尝试在另一个ViewController中显示它时,我收到一个错误消息,即插页式标识符在此ViewController中找不到。这是我正在使用的代码在AppDelegate.m中@property(nonatomic,strong)GADInterstitial*interstitial;-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launc

IOS 设置 UIViewController.view.frame = CGCGRect(x : -200. .) 不能点击按钮

我想把几个UIViewController放在一起:leftViewController.view.frame=CGRect(x:-200,y:0.0,width:size.width/drawerSize,height:size.height)//CenterDrawercenterViewController.view.frame=CGRect(x:leftViewController.view.frame.width,y:0.0,width:centerWidth,height:size.height)//RightDrawerrightViewController.view.f

ios - 缩放 super View 时如何防止按钮调整大小?

我在一个View中添加了多个手势,该View在View的一角有一个关闭按钮,一切正常,但是当我缩放时,该View关闭按钮也随该View一起缩放,现在我想缩放只有那个View而不是那个关闭按钮,请建议我如何做到这一点?请参阅下图以供引用。缩放代码-(void)addStickersWithView:(UIView*)viewimage:(UIImage*)image{CGPointcenter=self.imgPhoto.center;UIImageView*imgView=[[UIImageViewalloc]initWithImage:image];UIRotationGesture

ios - 为什么我在 Storyboard 中的 SKView 子类(用于 Spritekit) View 不接受任何自动布局约束?

我在Storyboard中有一个名为_gameView的UIView,我在Storyboard中对其应用了约束。它是SKView的子类,所以我可以在其中展示我的场景,但问题是它在运行时永远不会从Storyboard中的自动布局中获得约束,为什么? 最佳答案 SpriteKit场景由一种特殊的UIView呈现,SKView,并且不要使用自动布局。只有UIKit可以-自动布局处理UIView的排列。 关于ios-为什么我在Storyboard中的SKView子类(用于Spritekit)Vi

ios - 在 UIButton 上滚动时滚动 UICollectionView

我有一个带有水平UICollectionView和两个UIButton的View(固定在右侧和左侧,屏幕宽度为25%)。我的需要是在我开始拖动按钮时滚动collectionView而不会松开按钮的点击手势。我试图覆盖我的按钮的touchesMoved并将触摸和事件发送到我的collectionView但它不起作用。-(void)touchesMoved:(NSSet*)toucheswithEvent:(UIEvent*)event{[supertouchesMoved:toucheswithEvent:event];if(self.delegate&&[self.delegatere

ios - UITableview 在重新加载时滚动到顶部太高了吗?

我正在使用scrollRectToVisible:[self.tblArticlescrollRectToVisible:CGRectMake(0,0,1,1)animated:YES];和/或setContentOffset:NSIndexPath*top=[NSIndexPathindexPathForRow:NSNotFoundinSection:0];[self.tblArticlescrollToRowAtIndexPath:topatScrollPosition:UITableViewScrollPositionTopanimated:YES];和/或这个:[self.tb

ios - 当 UISearchBar 处于事件状态时,滚动到 UITableView 应用程序会崩溃

我的应用程序运行良好,但突然当我单击UISearchBar并且在向下滚动UITableView时没有输入时,应用程序崩溃并出现以下错误:Thread1:EXC_BAD_INSTRUCTION但是当我点击UISearchBar并输入一些文本时,当我向下滚动UITableView时,应用程序运行正常,它不会崩溃。最后,当我单击UISearchBar并键入一些文本并删除所有文本时,之后当我向下滚动UITableView时,应用程序运行正常,它不会崩溃。此函数发生错误:functableView(historyTableView:UITableView,cellForRowAtIndexPat

ios - 无法满足约束时,如何识别 Debug 区域中的 View ?

我正在使用Autolayout并以编程方式设置约束,但在运行该应用程序时遇到一些无法满足约束的错误,例如:Willattempttorecoverbybreakingconstraint我有几个像这样的UIImageView,我发现很难知道是哪个限制条件被打破了。无论如何设置,比方说,命名标签到View,以便在调试区域更好地识别它们? 最佳答案 Xcode的Autolayout已经提供了给constraints设置标识符的功能。使用此功能很容易找到不需要的约束。要将标识符设置为约束,只需在Storyboard上选择约束,系统会提示您