[TIMOB-125] Layouts are too limited
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:52:04.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | custom, embed, ios, iphone, layout, native, tableview, view |
Reporter | Kevin Holland |
Assignee | Reggie Seagraves |
Created | 2011-04-15T02:23:57.000+0000 |
Updated | 2011-04-17T01:52:04.000+0000 |
Description
I've been tinkering around with TI to see if i could port a game I've been working on over from obj-c to TI. In the process i've discovered that the apps you can create with TI are severely limited in layout options. I feel this is an issue that could prove fatal to the mass adoption of TI in general and hinder it's growth.
The issue comes to light when you wish to create an app with a custom designed layout, such as a layout with a fixed header and then a fixed height / width tableview beneath it. Currently ti only lets you use a webview or tableview for your views and they both take up the full real estate of the screen. There's no way to embed a tableview with a fixed height inside a webview (i dont think this is possible with apples api)
Why don't you use HTML to mimic a tableview you might ask? I thought of that and in my testing found that if you make a fixed height div with overflow:auto the iphone webkit ignores it and simply expands the height of the div to display all the content (no scrollbars sadly). While the same page loads fine with scrollbars in the regular safari.
The lack of an embedable tableview makes apps / games such as these examples impossible in Titanium's current form. If you go searching for games on the appstore youll find that probably 60% or more of the rpg ish games use this layout.
http://www.upchan.com/">http://www.upchan.com/img/large/6d6b5d6f8696c26a6625e45131c206d48b0c231e.jpg
http://www.upchan.com/">http://www.upchan.com/img/large/126aed1d15f44e92d0b55dfaf5b2f9c6873e8585.jpg
A possible solution would be i think to make a new "native" view type that you could embed both webviews and / or tableview inside of it. This would allow you to have the main view be native and you could mix and match web views and table views to create the desired custom layout. The obvious restriction of only being able to insert native objects in the native would be likely be needed.
While i'm on the subject. I would also love it if a ImageView object would be accessible for TI users to create. UIImageView has a built in animation system that is very very good and easy to use. I looked into doing something similar in jQuery frameworks and it's actually quite cumbersome. The only flipbook / slideshow custom animation class i could find was at least a few hundred lines of bloated code. While all you do with a UIImageView is provide an array of image file names and specify duration and whether or not it should repeat.
example:
NSArray flameimages = [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"flame1.png"], [UIImage
imageNamed:@"flame2.png"], [UIImage imageNamed:@"flame3.png"],
[UIImage imageNamed:@"flame4.png"], [UIImage
imageNamed:@"flame5.png"], nil];
flame_left.animationImages = (NSArray ) flameimages;
flame_left.animationDuration = .90;
[flame_left startAnimating];
Attachments
File | Date | Size |
---|---|---|
imob.jpg | 2011-04-15T02:23:58.000+0000 | 76829 |
ivamp.jpg | 2011-04-15T02:23:57.000+0000 | 57419 |