Scrollview issue - appcelerator-mobile

My view structure is basicly like that
<scrollview>
<view>
<subview>
</subview>
... 18 ..
<subview>
</subview>
</view>
</scrollview>
When user scrolls to bottom, i make a http request and acording to that request i create 20 more subviews and put them into to main view.
This has no lag when i test on android, but on ios, while loading new subviews, it disables scrolling and i need to wait about 3-4 seconds until its enabled to scroll.
Also I dont add this new subviews one by one, i create 20 of them and put them in to another temporary view and i add that temporary view to "view".
I thought this may happen because i add so many views, so i tried to add only 1 view but the result was still same.
Is there a way to do that without lag, i checked twitter, foursquare, pinterest apps, they work smoothly.

Related

What is the ember way to add popovers to views?

I'm working on a events board app. Events are displayed in columns at the height matching the start time and pack into the space if there is more then one overlapping. Each event is a view and I want to have a div next to the view that shows and hides on hover.
I know how to bind to mouseEnter and mouseLeave to show and hide part of the template but I want to show something adjacent to my view/template not within it.
I've already got some computed properties on the view to place the event with the correct height and width so I don't want to add the popover inside the view.
Here is something to mess with http://jsbin.com/osoner/1/edit
Seems like something simple but I want to make sure I'm doing things the Ember way.
After messing a little with your provided jsbin, here the results.
Basically what I've done was adding a new popup css declaration wich do position the popup so that it appears outside the parent view, and also moved the {{#if...}} helper into the originating view.
If you want to go more fancy, checkout this jsfiddle wich uses the twitter boostrap popover.
Hope it helps.

UITabBarController containing UISplitViewController doesn't handle rotation on iPad correctly

I’m experiencing unusual behavior on an iPad in iOS 6.1.2 when using a UITabBarController with a UISplitViewController (which has a UITableViewController for the master view controller). If I have multiple tabs, of which at least one tab contains a split view controller, and I am in landscape mode while viewing the tab that contains the split view controller, then I switch to another tab, then move to portrait mode, then press the tab that contains the split view controller, what happens next is that the master view controller (a table view controller) will display the table view over top of the detail view, when it is clearly not supposed to be there. This behavior happens only the first time the app is loaded, but is consistent behavior.
This scenario is easy to recreate by simply creating a project that is a split view application that uses an iPad device and Core Data (didn’t try it without using Core Data). After the project is created, use the storyboard and add a tab bar controller and make it the initial view controller, then add a view controller seque from the tab bar controller to the split view controller. After that, only one change is necessary in code which is to change the one line in application:didfinishLaunchingWithOptions in the AppDelegate.m:
Change the following template code:
UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
To:
UITabBarController *tbc = (UITabBarController *)self.window.rootViewController;
UISplitViewController *splitViewController = [tbc.viewControllers lastObject];
Perhaps I’m breaking some iOS rules, and trying to do something I’m not supposed to? All I want to do is to be able to tab between a few different split view controllers. Suggestions?
Take a look at this Git.
https://github.com/nalyd88/DCToolkit/tree/master/DCToolkit/DCToolkit
From what I understand the problem stems from the split view controller not updating it's orientation when it's not visible.
Here a subclassed tab view controller and split view controller are used which pass the message along.
Thanks to Dylan at http://objectiveseesharp.wordpress.com/ for this solution! I just found it.

Emberjs: Prevent back button from moving into another state

When a state describes a view rendered in a modal/popup, we ideally want the user to only navigate away from it through offered options i.e Save or Cancel buttons.
The back button presents a real issue when you design your application with states in mind and you use modals to render views in certain states (New, Edit ...).
Is there a way to hack into the states history to prevent, when desired, landing in a state through the back button.

How to show a ‘modal’ view (controller) *in* a tab bar interface without hiding the tab bar

I want to implement a ‘modal’ view like the ‘search’ view of the AppStore on the iPad.
When shown, it should:
Still show the tab bar. Selecting any of the items should take you to their view as normal.
No tab bar item is highlighted (because the search view is ‘modal’).
The closest I’ve come, with existing APIs, is:
On the ‘search’ view controller, set the UIModalPresentationCurrentContext modal presentation style.
Show ‘search’ view controller modal from the active view controller inside the tab bar controller (not from the tab bar controller itself).
However, this does not seem to be the right path:
View controller is shown underneath the status bar. I can work around that from -[UIViewController viewDidAppear:], but when changing the orientation of the device, this leads to all sorts of drawing issues and the controller, again, tucks itself underneath the status bar.
Tab bar item is still highlighted.
to keep showing the search bar just trim the modal view's hight so that it doesn't cover the tab bar.
For orientation changes, you just need to handle that by changing the view size and making sure the modal view is always brought to the front of all the views. You can modify that view's frame and contents programmatically or you can just create nibs for the orientations you want to support and load them up when it changes. Also note if you do change the view's frame programmatically you will probably need to resize/reposition fields as well.
For dealing with the tab bar, you should be able to turn off the highlighted item. So when you pop up the modal also make sure to turn off the highlighted item. If you want to interact with the toolbar from the modal view you can do that with delegates, passing an instance of the parent view (or just accessing parent view... I think you get that for free)

How can I reduce the loadtime when showing multiple like buttons (about 60 buttons)?

On one of my pages I'm showing about 60 items I would like to be "likeable" via facebook. The problem is that I can not use several pages to show the items since this would reduce the usability of the page. But when loading / showing 60 like buttons is just too much for my browser. The page is not usable anymore because even scrolling takes several seconds because of the impact of showing 60 likte buttons.
Does anybody know of an alternative way of using the like button? Would it be possible to build a custom like button which loads the like count from my local database and somehow triggers the facebook like mechanism when the user clicks on my own like button?
This could be done by building a custom like button which on click loads the real like button, hides it and automatically triggers the click on the real like button? Would this even be allowed or is forbidden by the facebook guidelines? If that is the case, is there any other way?
Best regards,
Daniel
Use a placeholder image and load them lazily via javascript when the user hovers on it. That's what Techcrunch does.
There are a few things you can do here that may speed up load times:
Make sure you're only loading the JS SDK once - the latest code from the Like button configurator takes care of this for you.
Load the JS SDK asynchronously, as described on the JS SDK overview page
Use the XFBML version of the Like button
You should use xFBML version of Like button and load the SDK asynchronously.
http://developers.facebook.com/docs/reference/javascript/
You cannot trigger the click of a like button in javascript.
You can however, hide the like button until the user hovers over the like button and create it then.
Something like this might be helpful:
http://www.reddit.com/r/programming/comments/k6kzy/german_publisher_heise_creates_a_privacy/