I am sure this is an easy question, but I am lost. I have MWPhotoBrowser and a bunch of photos loaded into the browser. Everything works beautifully, except if I click on an image in the browser and drag it around the screen it moves everywhere and repositions the image. Essentially I just want to stop if from dragging around all together.
Any recommendations ?
There were two issues causing this problem:
Autolayout was turned off. Since I wanted it to remain off I had to create a work around with #2.
The content appears to be sized to the View. In my case the view height was much larger than the available display area on the screen. To work around the issue I used another view sized to the viewable area and added the browser to that view rather than the super view.
Related
I'm trying to create a 3x3 menu, based on a grid of buttons, and I'm facing a lot of problems trying to adapt it to different screen sizes.
Since I want my menu to be equally spaced on the screen (using autolayout tricks on the Storyboard), I have created a custom class with this menu that i'm adding to the center part of the main controller view. The problem is that the menu doesn't fit in small screen (3,5" screens).
Trying to solve this problem, I have created a scrollView in the main screen to add the menu and be able to scroll in small screens.
The problem is that since the view I'm loading in the scrollview, automatically fits to the size of the container (in this case the UIScrollView), only a small part of the menu is appearing in the 3,5" screen, without the option of scrolling (In bigger views it appears equally spaced and everything appears correctly).
How can I solve this UIScrollView problem? Or there is a better solution for this problem?
p.s: I'm sorry, but I don't have enough reputation to add images :(
Uiscrollview with autolayout has some pain into it.
You need to place you're inner views so the scrollview Will be able to understand the contentsize it should use.
You can find more detailed info here
http://infinite-edward.tumblr.com/post/66865604683/uiscrollview-contentsize-and-autolayout-gotcha
My app adds buttons (as sub views) to a very large image which is itself inside of a scroll view. Everything works as intended (the user can zoom around and click the buttons), but the problem is that iOS system buttons seem to default to a very low resolution, and consequently look very bad when my large image is zoomed (see below).
Is there an easy way to change that resolution, or am I stuck supplying a high resolution image myself? If I'm stuck with the latter solution, then what am I to do if the button needs to contain dynamic elements which can't be supplied by me such as text?
I'm guessing that the solution is to add the button somewhere other than its current position in the view hierarchy (scroll view -> image view -> sub view), but I'm unsure where that would be.
Thanks for the help!
I am having a problem with UIWebView. My application displays pdfs from local memory and displays them in a webView in fullscreen mode. By default, when the page loads, the content is apparently set to fit horizontally, which cuts off some of the bottom of the pdf. I would like it to initially show up vertically fit and horizontally centered. I have looked for an answer to this question for quit some time and can't seem to find anything.
Any ideas?
(Please do not suggest scalesPageToFit. Although it fixes many beginning problems, this is not one of them.)
uiWebView.scrollView property has the ability to set zoom and also manage display of content
UIScollView class ref
I have a myriad of UIImageViews that act as 'tiles' on a map. They align up next to one another to form a grid of images.
Ordinarily, the grid images are flush against each other, but whenever the iPhone or iPad device is rotated, or if a UIView is applied to the view that contains these tiles, the spaces between the UIImageViews become momentarily visible, showing off the grid pattern that I'd like to be invisible.
Any ideas what might be causing this?
Thanks
Consider using CATiledLayer to draw all the images in a single view instead of using multiple subviews. There's a nice writeup on using it at Cocoa Is My Girlfriend. CATiledLayer makes it easy to build an image out of smaller tiles, display higher resolution images as the user zooms in, and avoid memory problems that come from keeping too much of a large image loaded.
this is happening because you are using different views (here uiimageview). Since they are not part of the same fabric during any animation or change in view hierarchy there is a chance that the gap between them would be visible.
This is a very common problem in graphics programming. The way to fix this problem is to have one single view and add these uiimageviews as sub-layers to this view. That way all the imageviews are part of the same fabric and the gap would not be visible.
I did not post any code but then so did you ;)
My app consists of 2 screen (main and settings) both are filled with scrollview completely. Each has one view controller and is supposed to support landscape and portrait orientations. I'm using Autosizing to achieve that and it works fairly well (all elements are where they should be, size is also correct) but I'm getting strange artifacts when the screen is rotated e.g. picker frame remains the same when the actual "drum" area inside is resized properly, text field is partially overlapped by background, landscape graph remains in place and is overlapped by portrait graph.
All are just basic elements without modifications, there are no images or anything special (graph is exception, I'm reloading it in didRotateFromInterfaceOrientation:). Any ideas why would that happen, why aren't the basic elements redrawn properly?
Figured it out myself in the end. Had to implement workaround as iOS apparently can't do it itself.
1) Artefacts after automatic view resize. Solution here was to hide the view before changing orientation, reload the graph and show it again after orientation was changed. Doesn't look perfect but much better than before.
2) Other problems were caused by the pickerview. Autoresize apparently doesn't work at all. The solution here was create UIView instead of the picker which resizes without problem and again recreate the pickerview every time the orientation changes.