简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM