Sorry, probably another silly question, but I've got a lot of information to put onto a pane of my RoR application, how do I implement scroll functionality so if the information is more then what should fit within a fixed pane (say 600 px wide by 600 px down), then a scroll option will automatically be available?
Even better if I can monitor the window size, and if there is more text then window then to automatically enable scrolling both vertically...
I suppose what you need is to style your container element. More to do with CSS rather than Rails
.some-container{width:600px;height:600px;overflow:auto;}
Related
For some reason I cannot get all switches to display properly on a screen. Some of them appear to be overwritten on the left edge but from what I can determine all of the switches and text views are correct. Any suggestions are welcome
So first, to make sure that this is the problem: while your app is running, click on the two rectangles overlapping on the right of the Debug Area to "Debug View Hierarchy"
When you have that, rotate your views to make sure that in every row you don't have your text views overlapping your switches. That's what it looks like what's happening, but you can use this tool to confirm so.
If so, and you are using auto layout, make sure you are setting your constraints correctly. If not, then make sure you are setting the width properly. To prove it's an autolayout issue, you could temporarily hard code a length to every text view to see if the issue is still there. If that fixes it, than auto-layout is just making your textviews wider than they should be.
Good luck!
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!
How do I autosize Labels so they contain all the text, but don't take up any more space then necessary and stay vertically spaced the same whether the user is in portrait or landscape mode?
I am trying to implement a simple control that displays information about my app in paragraph form. It will have Headings, and Paragraphs. I am having problems correctly positioning things relative to each other and have them auto adjust as the user rotates their device and changes orientation.
In the example below, I have 4 labels. 2 are for headings and are bolded with larger font, 2 have standard font, but are long and have lots of text. I want to be able to have all the text visible on each label and have none cut off. I also, want all the labels as close as they can be to each other. So, their containing rectangles have to change based on all of the other label's height. So when I change from landscape to portrait orientation, the paragraphs may take 8 lines instead of the 3 lines it takes in landscape mode. I want the controls to shift to have the same amount of Vertical white space between each of them.
Here is a sample:
About this program
Thank you for downloading this app. It is designed to do some
wonderful things and will make all your wildest dreams come true.
Help
In order to use this program, use the tab bar at the bottom of the
screen to select what you want to do. When the view opens, slide the
items across the view until you are done.
I'll quote Mattt Thompson:
This is the type of thing TextKit was created for. Check out Wenderlich's tutorial for an easy start.
I followed the advice in Jason's comment and it works like a charm:
Try using a UIWebView and embedded HTML for your content. – Jason Oct
30 at 19:23
Thanks Jason !!
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 two column site current set up using wordpress but an having trouble figuring out how to fix the right side column so that it does not allow it to scroll over the right side on the iPad. On desktops the page behaves as it should, however on iOS the div is able to scroll over the nav bar. My problem is the right column needs to be able to scroll vertically, so if I give it a fixed position I loose that functionality. Here is the link http://www.adamheimer.com, thanks to anyone who can help me out!.
Not entirely certain about what you're after, but have you looked at overflow-y:scroll style? It allows you ensure an element is a certain height, and if the element exceeds that height, the user is able to scroll it.