I'm having trouble with a UIWebView on both the iPhone and the iPad.
The page that I'm loading is generated by the app which uses the javascript syntax highlighter library ( http://alexgorbatchev.com/SyntaxHighlighter/ ) to syntax highlight the text that is loaded.
This works great, and it looks fine, however when I come to scrolling the webview I have problems. Horizontal scrolling is fine when you slide it, but when you let go it doesn't continue to scroll, so it seems like the inertial scrolling is not working?
Scrolling down on the other hand is completely different. When I can get it to scroll, the inertial part is working fine, but getting it to scroll is a bit harder. If you don't scroll down perfectly straight then it simply won't scroll down. If you do manage to get it straight, then you also seem to have to press and hold for half a second or so before you start scrolling, otherwise it simply won't scroll.
I'm getting really frustrated with it as I cannot find out what is going wrong!
Any help?
EDIT :
After more playing around, it seems that it is based on the HTML content, but I can't figure out what is causing it to mess up. If I load the content and don't run the syntax highlighter javascript function, then it loads fine, and scrolls without any problems and all is well. The moment I run the syntax highlighter I get the issues. The source that is produced by the syntax highlighter is here ( http://pastebin.com/c6Mnc9nb )
I know it looks horrible but it should be fine, and renders correctly. But as I say, that HTML causes the scrolling issues and I can't figure out why.
PLEASE can someone help! I really need this sorted so I can get my app published.
Doesn't matter. Just replaced the syntax highlighting library instead.
Related
I'm working on adding second screen functionality to AOSP for the LG V20.
So far, I've managed to set up the offsets so normal content doesn't overflow into the second screen area, and I've added the second screen window type (SIGNBOARD). The offsets are managed in LogicalDisplay.
For a lot of this, I've been following how LG originally did it (in Android 7.0, so things are slightly different on 7.1). The problem I have now is that nothing displays in the second screen area: I see some stuff LG did involving SurfaceControl, but that doesn't seem to be the actual solution, and I'm worried it might be in the native code.
I've tried Googling, but this doesn't seem to be documented anywhere, at least nowhere I could find.
So the question becomes: How can I force content to display outside of the bounds of the LogicalDisplay area?
These are the changes I've made so far: https://github.com/zacharee/android_frameworks_base/commit/cec4839c8cb1396810ce65d7ad9cae094f363ac4
I have searched multiple discussions/examples for hours re UITableView using UIRefreshControl, and found most predate iOS11, and fall into one of two basic implementations, neither of which are working for me. Either I pull down and it won't finish (i.e., control slides with spinning wheel, and swiping up merely bounces it back down - yes, I'm using .endRefreshing); or it successfully completes but not before flashing large title on top of control (with original title still pulled down), and table cells jump up and down.
I am using Storyboard, and checking the enable box. I am placing the code in ViewDidLoad, and have tried declaring a custom var outside and inside ViewDidLoad (as well as not using one, but that seems incorrect). In ViewDidLoad, I have tried using tableView's .refreshControl, as well as .addSubview. In the selector func, I have tried placing .reloadData above and below .endRefreshing. Every variation produces one of the above two incorrect behaviors.
I am new to all of this, and completely frustrated, as all I'm trying to do is learn how to implement the feature on an iPhone. I saw a post stating UIRefreshControl does not work as of earlier this month, but I find it hard to believe that Apple would just leave this rudimentary and ubiquitous feature broken for weeks+. Can anyone please help? Thanks, and happy holidays!
I'm solving a problem how to make tableviews work within three20's TTScrollView. I have a project which I want to rebuild using three20 library. There is one module which allows user to flip through set of "pages", which contains table showing some list of data.
My problem is that when I rebuilt this module to use three20's TTScrollView, tableviews inside the scrollview do not work anymore. In particular, it cannot be scrolled and cannot select an item, because all touches are intercepted by the scrollview. I'm getting mad about this and cannot figure out how to make it work.
I'm able to make work either tableview or scrollview but not both (means tableview intercepts vertical dragging, while scrollview horizontal). It worked fine with UIKit's UIScrollview, so there must be a way how to do this, but simply cannot figure out how.
Please help, I'm struggling with it yet couple of days now, but cannot get over.
thanks much for any hint.
Matthes,
Unfortunately not many people here at SO help out much with three20 questions for whatever reason. You may have better luck asking the three20 google group (search for that on google).
First guess though without trying it myself: try using three20's built in table items such as TTTableTextItem or TTTableImageItem ...in certain scenarios with three20, he has built in code to ignore everything you write except for his own built in controls (which might be the case here, not sure).
You can see examples of how he creates tables with this code in the TTCatalog example app that you can find via www.three20.info
I am following Chapter 5 in O'Reilly Learning iPhone Programming.
When I launch the app in Xcode, the list will scroll straight away to the bottom. When I try to drag the tableview upwards, it will go back to the last row when I release my mouse.
Unfortunately I am unable to post the codes since it has many sections.
Anyone has a clue what code might have caused this problem?
It is likely that the UITableView is actually extending off the visible screen. Use the debugger to check at runtime the frame of the table view. It is not scrolling because it thinks the content is fitting. Without seeing the code though, this is just an educated guess.
I grabbed the sample code for Chapter 5 from here: http://www.learningiphoneprogramming.com/pages/samplecode.html and I'm unable to duplicate your problem. Are you sure you didn't change any of the code? What is your Base SDK?
When I've learned that I have to write some code to make the iphone keyboard go away. I was quite surprised. I was surprised even more when it become apperent that it is just the top of the iceberg.
What are the expected UI behaviors that aren't provided by system OOTB?
Is the list below complete?
The expected UI behaviors:
Focusing next text field when [done] is hit
Hiding the keyboard when background is hit
Using Touch Up Inside to fire a button action. (To give user opportunity to change his/her mind)
Supporting the screen rotation.
Some of that is silly, but some of it has uses as well.
Focusing next text field when [done] is hit
Which field is "next"? If you have a large form with fields both next to and above/below each other, next might not be so obvious. Even if they are in some linear layout, the iPhone would have to work to figure out which one is next. Do you want to wrap around at the end of the form, or dismiss the keyboard, or submit the form?
Hiding the keyboard when background is hit
I mostly agree with you here, though there are a few cases where this is useless. For example, adding a new phone number in the contact app.
Using Touch Up Inside to fire a button action
This one I really don't get. I can only guess that it's designed to allow you to use buttons instead of the touchesBegan/Moved/Ended methods. I guess it could be useful, but I've never used anything but Touch Up Inside.
Supporting the screen rotation
Many apps just don't work in any other orientation, such as games. If you want to use rotation, you only have to add two lines of code assuming you've done your layout well.
I hope this helps explain some of the strangeness. Aside from the keyboard dismissal, I've never really found anything too annoying. The one thing I wish they supported was using the highlight state of UIButtons for the set state. It would be a quick and easy toggle button, but I've taken to screenshotting a highlighted button and using that for the background image of a selected button.
Want a rounded rectangular button that isn't white? Since that one uses a background image, you can't just click something somewhere that makes it the color of your choice. You have to create your own image or you could even use CSS (WTF!?) to do it.
Unfortunately, the iPhone SDK lacks a lot of helpful things one would think would just be there. However, many people have taken the time to write wrappers for many of these kinds of things to help facilitate development - a quick google search into the functionality you are expecting may turn up a lot of useful answers!
For example, you could make the keyboard go away when you tap outside of it by creating a new view when it appears, and placing that view behind any user-interactable views on the screen. When that new view is tapped, it will become first responder and cause the keyboard to slide away (because the UITextField is no longer first responder).
Such a thing could be easily implemented as a drop-in fix for pretty much anything you'd need it for with very little code.
Still should have been included in the SDK in the first place, though!