jjzjj

contentInset

全部标签

ios - scrollView 的 ContentInset

这是我的View,左边是键盘不显示时的View,右边是键盘显示时我想要实现的View。我所有的字段都被添加到一个ScrollView,然后我像这样设置约束,field1topConstraint设置为scrollViewtop,field4bottomConstraint设置为scrollViewbottom。所有其他字段都附加到下面的字段。正如您从最右边的模型中看到的那样,当显示键盘时,我想像那样重新调整View。所以我现在正在做的是:funckeyboardWillShow(notification:NSNotification){self.field2.snp_updateCon

ios - UITableView contentInset 的动画不一致

谁能帮我解决一个我想不通的动画问题。我在“拉动刷新”中实现了以下代码。[UIViewbeginAnimations:nilcontext:NULL];[UIViewsetAnimationDuration:0.3];self.tableView.contentInset=UIEdgeInsetsMake(50,0,0,0);[UIViewcommitAnimations];此方法也在viewDidAppear:中被调用,这就是我的问题所在。在应用程序的初始加载时,它运行良好。但是,当View在弹出View或关闭模态视图后出现时,它不会设置动画。我之前和之后都设置了断点,所以我知道它被调

ios - TableView 与滑动 View Controller 中的状态栏重叠

我正在使用ECSlidingViewController创建一个slidingViewController就像以前版本的Facebook一样。一切正常,但是当我将图像添加到单元格时,状态栏与menuViewController(tableViewController)重叠,如下所示。有谁知道如何修复它。 最佳答案 100%有效-(void)viewDidLoad{if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")){[self.tableViewsetContentInset:UIE

ios - 将 contentInset 或 automaticallyAdjustsScrollViewInsets 设置为实际应用后我必须做什么?

我有一个包含UIScrollView的UIViewController。最初automaticallyAdjustsScrollViewInsets未设置(因此它应该默认为YES)。在某些用户交互中,我将automaticallyAdjustsScrollViewInsets设置为NO,因此我可以在ScrollView上设置我自己的contentInset。这样做之后什么也没有发生。之后我必须调用什么?在ScrollView上调用setNeedsDisplay没有帮助。 最佳答案 如果您希望ScrollView的初始显示包含初始内容

ios - 设置 contentInset 后 UICollectionView 不滚动

我有一个水平滚动并跨越其父View的整个宽度的CollectionView。我实现分页的廉价方法是将单元格宽度设置为等于CollectionView宽度的1/3,并将宽度设置为与左右内容插图相同的宽度。我在IB中禁用滚动并替换为左右滑动识别器。我的代码几乎可以在不设置contentInset的情况下运行,但是设置contentInset似乎可以防止发生任何滚动-(void)viewDidLayoutSubviews{[superviewDidLayoutSubviews];CGFloatitemWidth=self.collectionView.bounds.size.width/3.

ios - 动画内容插图

我想为属于UIWebView的scrollView的contentInset设置动画。我尝试了下面的代码,但不幸的是inset在运行时只是跳转UIViewAnimationOptionsoptions=UIViewAnimationOptionBeginFromCurrentState;[UIViewanimateWithDuration:10.0delay:0options:optionsanimations:^{self.webView.scrollView.contentInset=UIEdgeInsetsMake(100,120,120,120);}completion:nil

ios - UIRefreshControl 未以 contentInset 集为中心

我在CollectionView中添加了一个刷新控件。一切正常,但是当我设置collectionView.contentInset=UIEdgeInsetsMake(0,20,20,20)时,刷新控件的宽度保持不变但移动了20px,因此不在View中居中。控件应该减少40px才能正确。self.collectionView=[[UICollectionViewalloc]initWithFrame:rectcollectionViewLayout:flowLayout];self.collectionView.contentInset=UIEdgeInsetsMake(0,20,20,

ios - UITableView contentInset 更改

我已经在方法-(void)viewDidLoad中设置了tableView的contentInset,属性是self.tableView.contentInset=UIEdgeInsetsMake(200,0,200,0);但是,tableView.contentInset将自动更改为:{64,0,0,0}。为什么会这样,我该如何解决这个问题?环境:XCode8.1iOS10.1#import"YAVideoViewController.h"staticNSString*constID=@"cell";@interfaceYAVideoViewController()@end@impl

iphone - UISearchDisplayController 重置 contentInset

我尝试将自定义contentInset设置为UISearchdisplayControllerssearchResultsTableView。初始化后_searchController=[[UISearchDisplayControlleralloc]initWithSearchBar:_searchBarcontentsController:self];_searchController.delegate=self;_searchController.searchResultsDelegate=self;_searchController.searchResultsDataSourc

ios - 通过 contentInset 属性添加边距在 iPad 上居中 UITableView?

我想在iPad上重复使用iPhone的UITableView,方法是添加左/右边距,从而使其居中。我尝试使用.contentInset属性,但它似乎并没有影响右边距。我错过了什么吗?(我尝试了负向右插入也不起作用。)(Hereisagistwithtestcode,您可以将其放入UITableViewController子类中。)//InaUITableViewControllersubclass-(void)viewDidLoad{[superviewDidLoad];//thespaceIwantoneithersideofthetableCGFloatxMargin=100.0f