uiscrollview

contentoffset in scrollview

谁说胖子不能爱 提交于 2020-01-25 11:01:06
问题 How can i set the contentoffset for image to track down which image user is on and selected to save it to phot album. UIScrollView *imageScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; imageScrollView.pagingEnabled = YES; NSInteger numberOfViews = 61; for (int i = 0; i < numberOfViews; i++) { CGFloat xOrigin = i * self.view.frame.size.width; NSString *imageName = [NSString stringWithFormat:@"image%d.png", i]; _image

How to make a button scroll inside a UIScrollView?

依然范特西╮ 提交于 2020-01-25 10:29:05
问题 It's possible to put a button inside a scroll view and make it scroll together with the view? I try to explain the issue. I have a scrollView containing a textView showing some text. In the text there's a link and i have a button, put beside this link that, when pressed, open the link in safari. Now, the text is longer than the textView, so i had to put the Text view inside a Scroll View to make it scroll. I tried putting the button inside the scrollView as well, but when i scroll, only the

Simply calling UITextView `sizeThatFits:` causes glitchy scrolling / input behavior?

两盒软妹~` 提交于 2020-01-23 08:04:02
问题 I find that in iOS 8 using UITextView sizeThatFits: causes glitchy scrolling behavior. The Text View is constantly scrolling away from the line you are typing on. It seems to be scrolling to the top of the view and then back again. If it matters, the view is set as an inputAccessoryView. Via the keyboard I'll type: 1 return 2 return 3 return 4 The TextView the moment before I type 4 : In the delegate method I call sizeThatFits: . - (void)textViewDidChange:(UITextView *)textView { [textView

Simply calling UITextView `sizeThatFits:` causes glitchy scrolling / input behavior?

做~自己de王妃 提交于 2020-01-23 08:02:10
问题 I find that in iOS 8 using UITextView sizeThatFits: causes glitchy scrolling behavior. The Text View is constantly scrolling away from the line you are typing on. It seems to be scrolling to the top of the view and then back again. If it matters, the view is set as an inputAccessoryView. Via the keyboard I'll type: 1 return 2 return 3 return 4 The TextView the moment before I type 4 : In the delegate method I call sizeThatFits: . - (void)textViewDidChange:(UITextView *)textView { [textView

Center UIImageView inside UIScrollView without contentInset?

徘徊边缘 提交于 2020-01-23 06:58:26
问题 I have been unable to find the answer for this issue I am having. I have a UIImageView inside a UIScrollView, and I would like the center its content vertically. Right now, the only way I have been able to do this is by setting the scroll view's contentInset based on the height of the UIImageView size, but this is not a perfect solution; it just increases the size of the UIImageView, making the UIScrollView 'think' its content is bigger, and adds these black bars to the top. I've tried to get

Center UIImageView inside UIScrollView without contentInset?

∥☆過路亽.° 提交于 2020-01-23 06:58:23
问题 I have been unable to find the answer for this issue I am having. I have a UIImageView inside a UIScrollView, and I would like the center its content vertically. Right now, the only way I have been able to do this is by setting the scroll view's contentInset based on the height of the UIImageView size, but this is not a perfect solution; it just increases the size of the UIImageView, making the UIScrollView 'think' its content is bigger, and adds these black bars to the top. I've tried to get

Dragging views on a scroll view: touchesBegan is received, but no touchesEnded or touchesCancelled

断了今生、忘了曾经 提交于 2020-01-22 20:42:09
问题 As an iOS programming newbie I am struggling with a word game for iPhone. The app structure is: scrollView -> contentView -> imageView -> image 1000 x 1000 (here fullscreen): I think I have finally understood how to use an UIScrollView with Auto Layout enabled in Xcode 5.1: I just specify enough constraints (dimensions 1000 x 1000 and also 0 to the parent) for the contentView and this defines the _scrollView.contentSize (I don't have to set it explicitly) - after that my game board scrolls

UIScrollView with scaled UIImageView using autolayout

别来无恙 提交于 2020-01-22 17:48:06
问题 Consider a UIScrollView with a single subview. The subview is an UIImageView with the following size constraints: Its height must be equal to the height of the UIScrollView . Its width must be the width of the image scaled proportionally to the height of the UIImageView . It is expected that the width of the UIImageView will be bigger than the width of the UIScrollView, hence the need for scrolling. The image might be set during viewDidLoad (if cached) or asynchronously. How do you implement

IOS: choice a UIScrollView or a UITableView

自古美人都是妖i 提交于 2020-01-22 13:36:07
问题 In my app I should create a view with a loto of informations; these informations are divided in 4 section, every section can contain text, images lists ecc... this is a brutal example... Now I'm dubious to what type of solution to adopt. In a my fast opinion a big scrollview is difficult to organize. And a big tableview with section is complicated to organize with code... What are your ideas? 回答1: You should go with UITABLEVIEW , easy to manage easy to understand, more reusability and good

UIWorkIntervalTiming workIntervalStart

情到浓时终转凉″ 提交于 2020-01-22 04:56:06
问题 Getting console log while scrolling ScrollView . Is there way to remove this? 2019-03-27 12:33:34.109573+0530 MyApp[10465:46241] [UIWorkIntervalTiming] workIntervalStart: startTimestamp > targetTimestamp; rolling forward by 1.116667 回答1: I can observe the same issue with a UICollectionView and UITableView . I suspect it is a diagnostic output used to analyse the scrolling performance. Note: I notice this issue from Xcode 10.2 in UICollectionView if you swapping too much faster than collection