uiscrollview

Activity Indicator while loading images inside UIScrollView

谁说胖子不能爱 提交于 2019-12-24 11:35:50
问题 I have UIScrollView that contains images from the server. I should put Activity Indicator while the image is currently loading. UIScrollView contains dynamic number of images from the server. May I know how can I add activity indicators on each page while the image is loading and remove once image is loaded. Here's my code to retrieve images: NSDictionary *items = [NSDictionary dictionaryWithObject:dictInfo forKey:@"images"]; imageList = [items objectForKey:@"images"]; NSArray *img =

How to move from custom to transluscent NavigationBar and back? Display problems!

会有一股神秘感。 提交于 2019-12-24 11:28:23
问题 So, i got this Navigation-based App (with a custom NavigationBar - Category) and I have 2 problems here... @implementation UINavigationBar (Custom) - (void)drawRect:(CGRect)rect { UIImage *image = [UIImage imageNamed: @"bg_toolbar.png"]; [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; } @end Because of the Navigation-based App, most of the views have a height of 436px (= ScreenSize - NavigationBar height, as you probably know ;). I got one view similar to

UICollectionView Scrolling is Very Choppy

安稳与你 提交于 2019-12-24 11:26:55
问题 The scrolling on my UICollectionView is really choppy. As I scroll past half the screen, it gets stuck for a moment and then proceeds. How can I make the scrolling more smooth using SWIFT? 回答1: Use Time Profiler instrument to find out where the bottleneck is. Swift has nothing to do with scroll view's performance. 回答2: There are two complementary ways: 1) [Fast way] When choppy effect is large enough for giving you time for pressing pause button on the debugger. And then review what is doing

showing images in UIScrollview horizontally on ipad and getting tag of image on tap

≯℡__Kan透↙ 提交于 2019-12-24 10:54:29
问题 I am showing images in UIScrollView with UIImageView.I added UIGestureRecognizer to each ImageView and also I am setting tag property of Image View.I want tag of Image view on Tap on particular Image View.But I am only getting Tag of last ImageView.Pasting Code below.Your help will be appreciated. UITapGestureRecognizer *tapRecognizer; tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageViewDidTapped:)]; tapRecognizer.numberOfTapsRequired = 1;

UIScrollview with two images - Keeping 1 image zoomable and 1 image static (fixed size)

会有一股神秘感。 提交于 2019-12-24 09:36:57
问题 I have a UIView which contains a zoomable UIImageView and also another semitransparent UIView on top of that. What I am trying to achieve is to be able to zoom the UIImageView while keeping the semitransparent view static and not zoomed. If I add the semitransparent UIView on top of the UIImageView (which is added to the UIScrollView ), everything zooms. However, if I add both as subviews to the base UIView , the touches only get tracked is the semitransparent UIView since its the last one

UIView is not showing up in UIScrollView

淺唱寂寞╮ 提交于 2019-12-24 09:25:52
问题 I am currently dynamically adding a UIImage to my UIScrollView object and everything is working as intended. I need to add extra functionality now (a UIActivityIndicator in the center of the image when it is loading from the internet, and a label underneath) so I thought why not create a custom View which has all of these laid out as I need them to be, and then just load it into the scrollView. I have encountered a problem though, when I add it to the scrollView, nothing shows up. Here is

App crashes when </ScrollView> put at end

十年热恋 提交于 2019-12-24 09:03:35
问题 full file follows: trying to have full scroll vertical in android device but putting scroll view at end of file produces crash `<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen

xamarin.iOS Vertically scroll through Images

别等时光非礼了梦想. 提交于 2019-12-24 08:35:59
问题 I'm attempting to build a UI in Xamarin.iOS which allows a user to vertically scroll through a list of images. I'm unsure what the best approach would be. I have looked at using UITableViewSource however I'm not sure if this would be the best approach. The data that I want to display is not really tabular it's just a list of images. Is there a way to mould UITableViewSource to just show an image that's as wide as the screen, allowing the user to scroll down through them. Or would a better

Disable diagonal dragging in UIScrollview

风格不统一 提交于 2019-12-24 08:09:49
问题 I am using UIScrollview to load my two views let say A and B . It exactly looks like the below picture. I set PagingEnabled as YES and DirectionLockEnabled as YES . When I drag the view from A to B it goes diagonally. Please find the code below, - (void)setupScrollView:(UIScrollView*)scrMain { for (int i = 0; i < 2; i++) { if (i == 0) { // View A [ViewA setFrame:CGRectMake((i)*scrollview.frame.size.width + 20, 0, scrollview.frame.size.width - 40, ViewA.frame.size.height)]; [scrollview

'scrollViewDidScroll' does not catch movement continuously

谁都会走 提交于 2019-12-24 07:34:58
问题 I am writing program to move an UIView named "myView" while scrolling a UITableView, Look at the pic below: "myView" will change its 'y-coordinate' along with the change of the contentoffset of tableview, the main code I write is: func scrollViewDidScroll(scrollView: UIScrollView) { let off_y = scrollView.contentOffset.y let new_y = originalMyViewY - off_y if new_y <= 0 { print("bad new_y : \(new_y)") return } else { print("right new_y: \(new_y)") } var frame = self.myView.frame frame.origin