Change Resolution of iOS System Button - ios

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!

Related

Good approach to autosizing buttons to match graphic designer's intent in Swift/Xcode?

I am trying to match my graphic designer's interface design to be exact in every IOS device. My problem is the images on the buttons are never the right ratio and I am having trouble making sure the buttons autosize correctly.
This is a picture of the artist's intent
This is my implementation of the buttons using different views
How do I resolve these autosizing issues to correctly solve this problem? I have watched plenty of tutorials on resizing images, but I haven't seen any that cover images that aren't symmetrical.
If you simply wish to resize those "buttons" (which I assume are actually UIImageViews) depending upon the device, create a relational constraint between the button image and the parent views (in your case, I suppose these should be the black and white UIViews). You can accomplish this by tapping both of the views at the same time and then "Create width/ height constraint".
Then, select the constraint and tap the "Show Utilities Area" (the most top right corner button). You'll have there in the Attributes a Multiplication property. The default is 1. Keep in mind that if the first element of the relational constraint is the parent view, then the multiplication factor has to be lower than 1 and viceversa.
EG: I suppose your button should always have a 1/6 part of the screen. Then, you should write in the Multiplication property of your constraint either 1/6 or 0.17.

Different iOS devices size programming approach

I am starting a new project which should be working on every iOS device size possible.
The project is rather simple. The main view will be a scroll view and it will hold a '+' button (where it says 'button' in the image) in the top right corner. (It does not really matter, I'm just trying to give the general idea of what I'm trying to understand and implement.)
A small example:
What is the right approach for this kind of problem?
Should I create a different storyboard for each device?
Should I start creating an adjustable scroll view that will hold the needed buttons with some constraints (if at all possible)?
I have read this tutorial:
auto layout
which explains the auto layout nicely, but does not mention the issue I'm trying to figure out.
Any thoughts?
Use AutoLayout and position your views relative to one another (so no x pixels spacing between views). Make only one storyboard for all devices, when a different view should be loaded on another device (like a completely different layout), select the appropriate size class and adapt the views and constraints.
Then it will be recalculated on every device.
The storyboard has a preview section where you can choose a device to simulate the view on.

AutoLayout button with image is resized to actual image size

So, using Objective C, I have a button to post to Twitter. I saved the image and placed it in my supporting files. I have the button looking like this: http://i.imgur.com/z8Pswxq.png in the storyboard.
But when I go to simulate the app with iOS simulator for it ends up looking like this: http://i.imgur.com/KW3oQYg.png
It seems to revert back to the size of the actual image no matter what. I can't seem to see a way to make it the size of the button. Unless is there a way to programmatically do it? Probably missing like, a checkbox somewhere.
I'm sorry about posting the links instead of using images: have like, 1 reputation.
Presumably you don't have any explicit constraints that are dictating the size of your button. The size of your button is being dictated by the button's intrinsic content size. In this case, that content size is the image size.
Either resize your image (e.g., programmatically or in your favorites graphics program), or install explicit constraints on the button that dictate the button's size. The constraints could be installed in IB by control-dragging with zero code.

MWPhotoBrowser - Images moving inside view

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.

IOS - How to get my text view object information to scroll on view?

I am using Mac OS X Lion 10.7.5 and XCode Version 4.6.1 (4H512),
I have looked at these answers on stackoverflow to try to figure out my question
-cannot make a text view scroll - xcode 4.3
-also posts that looked possible, when I searched on "scroll text in UITextView" within stackoverflow
Within Interface Builder I cannot figure out how to make information in a UiTextView object scroll within the iPhone simulator*. To resolve this challenge, I have made the most simple prototype project I can think of, just a view and one text view object on it, filling the text view object with a stream of text simply typed in via interface builder. For this most basic sample I'm using to sort out my problem, I have not done anything programatic. (Please note that I am aware of StoryBoards and have begun working through a book to learn to use them, but I would like to finish my first prototype app using what I’ve already learned and fully complete one project before I move onto my next project using StoryBoards.)
When I run this in the iPhone simulator, I see the sample information in my text view object come up. As I expected not all the information displays, due to my sizing the box a little too small on purpose. But I cannot flick or arrow down, or in any other way view the rest of the text information within the simulator. Nor do I see scrolling bars anywhere on the view. The information is just frozen in/on the view.
Inspector Settings
Identity Inspector
"Accessibility" Tested both with Enabled checked and not checked
Use Auto Layout is NOT checked
Attributes Inspector
Behavior Editable box not checked
Scroll View Area Checked ‘show horizontal scrollers, shows vertical scrollers and also scrolling enabled” The rest of the scrollers box are not checked
Bounces is checked
Zoom min and max are both 1
Touch all boxes checked- bounces zoom, delays content touches, cancellable content touches
View mode is ‘scale to fill”
Interaction ‘multiple touch’ is checked
Drawing checked opaque, clears graphics context, clip subviews, and autoresize subviews. Only ‘hidden’ is not checked
Size Inspector
I played around with the ‘scrolling insets’ boxes changing them from the default (I think it was 0 or 1), just to see if I noticed anything. I think maybe that I see some shadowy marker type lines in Interface builder in the area where I might expect a scroll bar when I make these changes, but no change in appearance within the simulator.
I cannot figure out why my actual iPhone device with everything up to date, is now not working as a test device, but I believe that is a separate challenge
how about wrapping you uitextfield in a uiscrollview. Make the scroll view the dimensions you currently are setting the uitextfield to, then allow your uitextfield to scale to the size of the text.
This is one of those questions that solved itself eventually. After twice creating the most basic app, with no programmatic bits just interface builder and a textView object with all the defaults the scrolling worked. The only reason I can think of that it might not have scrolled as expected the first time through may have had to do with placement of the textView object on the view. I wonder if it overlapped the bottom of the view and maybe that messes something up.
Just one of those situations where I had to keep plugging away, trying what seemed like the same thing repeatedly,set in the Inspectors, and suddenly, like magic, it worked. Except no magic involved.

Resources