Tag: uiscrollview

在UIScrollview滚动延迟的UITableView

我有一个UIScrollView ,我添加了许多viewcontrollers有UITableView在该scrollview ,其实我的要求是,当我在屏幕上水平滚动它将切换到下一个content.Now当我垂直滚动表,然后水平滑动它不水平滚动,直到表停止垂直滚动。 如果您有任何build议,请帮忙

dynamic设置放置在UIScrollView中的UITableView的框架大小

我正在使用swift,并有一个包含UIViewController的故事板,其中包含一个带有UITableView的UIScrollView。 我想要做什么是加载表中的Excel文件,所以我需要水平滚动。 我可以设置滚动视图的内容大小: scrollView.contentSize = CGSize(width:3500,height:scrollView.contentSize.height) 我也需要设置UITableView的框架大小。 当我从故事板设置它显示字段的作品,但是当我从viewDidLoad方法编程设置它不起作用。 宽度值显示为更改为3500,但是当我检查tableView cellForRowAtIndexPath方法时,我看到故事板中设置的值。

UIView不在UIScrollView委托中触发方法

我想知道是否有人可以请摆脱一些为什么UIScrollView委托的任何方法没有被解雇。 设置场景。 我有一个UIViewController被推入到堆栈。 在这个视图中,我有5个自定义选项卡,我已经做了。 在每个水龙头的一个水龙头,我有一个从UIViewController / xib组合的5视图(每个选项卡一个)加载function。 ExercisePhotoView *exercisePhotoView = [[ExercisePhotoView alloc] initWithNibName:@"ExercisePhotoView" bundle:nil]; exercisePhotoView.exercise = self.exercise; [self.photoView addSubview:exercisePhotoView.view]; [exercisePhotoView release]; 在这些被加载的视图之一,我有一个滚动视图与一些图像(上面的代码块是说的看法)。 self.exercise是一个NSManagedObject。 图像加载到滚动视图控制器和分页工作正常。 但是不pipe用的是ScrollView的委托方法,比如 – (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)theScrollView 我已经在头文件中包含了对委托的引用。 @interface ExercisePhotoView : UIViewController <UIScrollViewDelegate> { IBOutlet UIScrollView *scrollView; IBOutlet UIPageControl *pageControl; Exercise *exercise; NSMutableArray *exerciseImageList; } 有什么我失踪或做错了。 我无法获得任何委托方法在ExercisePhotoView类上触发。 先谢谢你。

UIScrollView决定拖动和点击

我试图确定在一个UIScrollView视图内的单个选项卡。 问题是UIScrollview捕捉所有的手势。 我到目前为止所尝试的:我在我的UIScrollView覆盖下面的方法: -(BOOL)touchesShouldBegin:(NSSet *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view { UITouch *touch = [touches anyObject]; if([touch tapCount]== 2) return YES; return NO; } 这工作正常,我现在可以到达我的UIView的UITapGestureRecognize,不幸的是我只能检测双击,因为[touch tapCount] == 1总是被调用(拖动或放大UIScrollView)。 但实际上UIScrollview并不需要“单抽头function” 有没有办法来决定之间的拖动(滚动或缩放)和一个单一的水龙头在这种方法? 我无法find它.. -(BOOL)touchesShouldBegin:(NSSet *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view 在此先感谢Fabi

如何在Swift中以编程方式将naderView从nib添加到UiTableView

那么我是一个天真的iOS开发人员使用迅捷的语言。 我有一个表视图,它显示了一个酒店的function列表。现在我想添加一个标题信息到tableView与酒店图像,酒店名称上面的tableview,使标题信息也滚动tableview内容(产品function列表) 这是问题,TableView与function列表工作正常。 class HotelDetailViewController: UIViewController,UITableViewDataSource,UITableViewDelegate { @IBOutlet weak var categoriesTableView: UITableView! var items: [(String, String,String)] = [ ("Service", " Courteous service, Good staff , Good staff"," Bad Facility"), ("Vibe", " Courteous service, Good staff"," Bad Facility"), ("Hotel", " Courteous service, Good staff"," Bad Facility"), ("Room Facility", " Courteous service, Good staff"," Bad Facility"), ("Amenities", […]

如何在放大CATiledLayer时绘制非转换的上下文?

我正在使用CATiledLayer来显示数据。 默认情况下,drawLayer函数获得转置和缩放的上下文,这允许绘图代码不知道缩放级别和正在请求的图块。 但是,我想使用缩放function来改变数据的水平范围,而不会发生实际的缩放。 到目前为止,我得到了这样的代码: (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { /* retrieve the transformation matrix from the context. */ CGAffineTransform contextTrans = CGContextGetCTM(context); /* Scale the context back, so all items will still have the same size */ CGContextScaleCTM(context, 1.0/contextTrans.a, 1.0/contextTrans.d); <.. loop through all datapoints ..> { /* Transpose the point-centers to the new zoomed context */ […]

左值作为赋值的左操作数

我想分配suitSize scrollButton我做错了什么? UIView *scrollButton = [suitScrollView viewWithTag:1]; CGSize suitSize =CGSizeMake(10.0f,10.0f); (UIButton *)scrollButton.frame.size=suitSize;

iOS scrollView的setContentOffset同步问题

我用一个子视图初始化一个UIScrollView。 button后,我想要: 添加一个新的子视图 用animation滚动到新的子视图 animation完成后删除旧的子视图。 为此,我做了以下几点: [mCubeView setContentOffset:tOffset animated:YES]; [tActualSide removeFromSuperview]; 问题是,在animation开始之后,“tActualSide”立即被移除,并且也将从animation中移除。 我想同步它,tActualSide只会在animation结束时被删除。 我怎样才能做到这一点?

在子视图中按下button时,应用程序崩溃

我有一个scrollView的大问题。 我有这个代码,当我按下“registerView”的xib文件中的一个button,然后该应用程序崩溃: MainViewController.m: viewDidLoad中: UIScrollView* scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)]; scrollView.backgroundColor = [UIColor whiteColor]; scrollView.scrollEnabled = YES; scrollView.pagingEnabled = NO; scrollView.showsVerticalScrollIndicator = YES; scrollView.showsHorizontalScrollIndicator = YES; scrollView.contentSize = CGSizeMake(768, 1900); [self.view addSubview:scrollView]; RegisterViewController *registerView = [[RegisterViewController alloc] init]; [scrollView addSubview:registerView.view]; “注册scrollView ”被添加到scrollView ,但是当我按下“注册scrollView ”中的button应用程序崩溃与此日志: 2014-05-12 11:18:04.599 RegisterForm[16505:60b] -[UIScrollView modalPresentationStyle]: unrecognized selector sent […]

UIScrollView iOS应用程序中的animation

我正在开发一个iOS应用程序,我有一个全屏的UIScrollView与UIImageView在顶部和2个UIButton在底部。 当用户滚动我想插入一个animation的图像视图(也许只能改变alpha参数逐渐)。 animation与滚动视图相关,例如,如果用户滚动滚动视图一半,将仅显示一半animation。 我希望我解释一下自己。 我怎样才能做到这一点?