Where are the standard looking iOS controls\styles in Delphi XE2? - iphone

We are currently in the process of evaluating Delphi XE2, and as you would expect I've started with FireMonkey as OS X and iOS development is of great interest. I've seen a couple of walkthrough's where people have created iOS apps using XE2 and I've managed to do the same, however the bread and butter of 'business applications' on an iPhone (which is how iOS support is being marketed) are buttons, lists, grids and connectivity (REST?).
Anyway, once you've created your iOS HD project the TButton initially looks green, whereas the TSpeedButton and TToolbar looks exactly like it should (blue gradient). The TToolbar doesnt have any way of adding buttons, presumably this is just a Panel, then?
Has anyone created styles for FM iOS HD apps, or do any of the wrappers allow direct creation of the standard iPhone controls?
I apologise if that sounds a little backwards given that I am attempting to evaluate using the trial version (which among other things doesnt provide the source, for obvious reasons!).
Thanks,
Ross

FireMonkey does not have standard iOS or OS X components. It draws all the components on its own, using a complicated set of layered sub-components, which are all editable with the FMX style editor in the IDE (or with a text editor outside the IDE).
So you can mimic the iOS or OS X components with the styles you get with the product or with your own custom styles. But to use the original UIKit/Cocoa Touch components, you'll have to use the FreePascal translations and conversions of the original Apple headers, and not FMX.
There is no designer for such UIs, unless you want to use Xcode 4.x. I don't know if FreePascal can load and use .xib files, though (although, why not? Probably just not automatically). You can, of course, create and place such components in code, at runtime.
So you either:
use FMX and design your own styles or modify the existing styles to your need, or
use Xcode and .xib files. Not sure how to do that with FreePascal.
FWIW, you can place any FMX component on any other FMX component (e.g. also a textbox on a button on an arcdial on a list item in a listbox), so it should be possible to place buttons on a toolbar. You probably have to take care of their alignment and arrangement, though, and probably also for their behaviour. Use a TLayout, Padding, Margins and alignment for that.

Related

How is styling of the UI for an IOS Apps done?

So with websites on the web we use HTML, CSS and Javascript.
What do we actually use to build the UI for an IOS App?
Is there a CSS/HTML/JS equivalent use for building IOS Apps?
What is the most common way use to design, style the UI of an IOS App?
The reason I ask is because I'm spending longer than expected learning core graphics and would like to move on with the book I'm studying from. I was under the impression core graphics was used for styling of apps and it was like an IOS equivalent of CSS.
Hoping someone could help clear things up thanks.
Regards
In many cases, images are used for styling in iOS.
For simple things like just changing background and text colors, UIView and its subclasses have direct accessors.
For most things, you won't need core graphics just for styling purposes. It would be easier to help you if we knew more concretely what you want to achieve, though.
The closest thing to a CSS equivalent is appearance proxies, which allow you to specify things like "all instances of UITextField should look have this font, colors and shadow when contained inside a NavigationController". You can override this for specific instances by just setting the desired values on the instance.

How to make iPhone app "skinnable"?

I was asked by a client to make a "skinnable" app and I don't really know what that means.
I googled like crazy and I didn't found a clear answer or an example.
If anyone has a clue about this, any tip would be appreciated.
Thanks.
Generally this means the app will allow the user to choose different looks for the UI, each of which will have a different color scheme, feel, etc.
What I actually did with my project. I decided to use multiple storyboards to give me greater control over the entire UI and UX of each theme. I programmatically link them all together via a master storyboard that links them all together. That's what I did, and it works very very well. Performance is great, while still maintaining high level of fine grain control over each theme. You can even keep your Header and Implementation files the same for individual view controllers, just so as you keep the names the same on the storyboard.
So for instance, one of my apps that I'm working on called Jam-mout (A music player) has multiple high quality themes. (Image attached). Each theme has it's own storyboard.
For iPhone apps, where the majority of the GUI design is provided by the operating system, you could do it by setting custom Navigation bar background images, custom button graphics, and different fonts/sizes/weights and whitespace. Make sure you're working with a designer who's familiar with the iPhone GUI (if you're not working closely with a designer this is going to be a nightmare).
I recently put together an app for a client who wanted a heavily customised GUI: http://itunes.apple.com/us/app/gogoparis/id428497937?mt=8. A 'skinnable' app would have several sets like this, so the user could choose between several different overall styles. (I hope your client has an enormous design budget!)
my post here should help you get started:
What is the recommended method of styling an iOS app?
if you need live theme changes, each theme in this example could post notifications when the user selects another theme (or skin) - then you can update either the theme instance itself.
alternatively, you can create identifiers for themes which are mapped (NSCFDictionary) to a central theme factory. an example identifier for a specific view for use with the theme factory could be a string MONImageSelectorTableCellThemeIdentifier.
an example manager/factory which handles all theme loading and vends references to themes:
#interface MONThemeManager : NSObject
//...
- (MONTheme *)themeForCurrentlySelectedSkinForViewWithIdentifier:(NSString *)identifier;
//...
#end
beyond that, it's hard to answer your question in more detail without knowing your requirements. the implementation of skinning an app can range from very simple to very very complex. good luck.
Already some good answer here, but I'd add that if you use a ui toolkit such as Three20
you can skin everything using CSS as you might for web pages.
I do realise this is an old post, but I thought I'd share my penny on the matter:)
To make any Cocoa app skinnable you need you think of 3 aspects of the app:
1) Uniformity: By this I mean that on all windows, views (including buttons, text inputs etc...) you want to have a 'standard' that will apply throughout the app. This is the first thing you need to look at. Although iOS and OS X alike already have 'themes' as to put it i.e. Apples default way of shading and laying things out, you can override these (refer to the individual view / window etc... documentation.
2) Performance: With skinning etc... performance is always an issue when it comes to writing your own drawRect etc... methods. The code apple have in place for the 'default' is already optimised, so you need to keep a close eye on the performance of the app whilst you are doing this. Good examples are: Do I use an image with a gradient, or do I use NSGradient? Both of which have performance issues when it comes to rendering them, but it's a question of which is the better of the two
3) userDefaults: This is generally the area where you'd be getting your 'skin settings' pulled from. userDefaults is basically where you store all of the information which you generally set in a preference pane.
If I were you I'd look into the class reference of it:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/
Furthermore, here's a nifty example of using userDefaults:
http://mobile.tutsplus.com/tutorials/iphone/nsuserdefaults_iphone-sdk/
Hope this helps!

How do you build or modify the user interface for an iPhone App?

What application is used for creating iPhone user interfaces?
Do you write code for layout, is there a css-esque system in place etc?
Or is it more like creating a winforms application where you drop in the elements in a visual designer?
Is it difficult to modify the appearing of an existing iPhone application, say to change the graphics used for buttons, and background colours on certain screens etc?
Additonal Info
The reason I ask is that I have a Blackberry application that I want converted to an iPhone application, and I need to know if I have to tell the developer translating it to build it in a certain way, as I need to be able to change the graphical appearance of this app.
I need to be able to change any background colours, logo, and the buttons used. Not sure if the iPhone uses images for "buttons" on the GUI?
You can either create UI completely in code, or use the Interface Builder visual tool to create pre-made UI objects, or any mix of the two. You can also modify an object loaded from an IB .xib file in your app's code.
To modify stuff created in code, you would need to edit the code and recompile. To modify objects created in interface builder, you would still need to rebuild the app (assuming stock tools and OS) with those new objects.
You can use Interface Builder, something like visual designer you said, to create xib (xml based) file for the UI. You can also create UI manually by code.
If you're more familiar to using css to layout UI elements, you can make a site for safari fitting the device's resolution, or put things into a html string and load it into a UIWebView.
You're able to modify the graphics, but you cannot put the app back to your phone unless you JBed you phone.

ipad app skinning structure / methodology?

I'd like to offer my app users a couple of different skins to use for the app, a default black skin and then say a white skin. Maybe allow them to set fonts and / or font color site wide for headers or whatever.
What would be the best approach to do this? Obviously I don't want this to affect the speed of my application.
You basically have 3 options.
HTML5 + CSS in UIWebView
Depending on your needs, the most flexible way would be to provide part of the user interface via UIWebView as HTML5 and CSS, and let the users (or theme makers) create different CSS based styles. This is what most applications do; IM+ or Colloquy for instance.
Modifying the native controls by subclassing them
Apple might reject apps that modify the native controls and views. So that is not a secure option if you want to submit your app to the App Store.
Create your own UIView subclasses and implement their behavior
Option three would be to draw your own controls using subclasses of UIView, but that might be more work than it's worth. You find this in many games on iOS.
For storing and accessing properties like colors and other parameters that make up the user interface, I'd suggest using something simple.
In some of my apps I use a JSON file (or alternatively XML - but that's more work to parse). There is TouchJSON (github.com/schwa/TouchJSON) which does an excellent job in simply converting a file into an NSDictionary, which is easily accessible. You could, for instance, store colors and font names and sizes in such a file and read one of them at launch time.

How can we use CSS for developing native iPhone app?

I am not developing any web app.
I am trying to use CSS in developing iPhone native app.
I am confused about where to include it and use it .
Whether to use it in the viewDidLoad or applicationDidFinishLaunching .
I am really getting tired of using the same UI look.
Can any body help me?
Thank You All.
The question you seem to be asking is "How can I make my UI skinnable" which is completely independent of any kind of technology for representing those choices.
If you want to built an HTML based application, then you can either have a UIWebView or develop a web-based application, both of which can be skinned with CSS.
If you want to make a UIKit application customisable (by changing background colours etc. and the like) then you'll have to roll your own way of doing that. CSS would be overkill for this purpose, and in any case, there is no 'standard' support for themeing applications. You might as well just write into the user defaults (probably via a settings bundle) what the user would prefer as a background colour etc. and then write a method to traverse your UIKit hierarchy to change the background colour as appropriate.
What are you trying to apply the CSS to? CSS is only going to be applicable to a UIWebView in general. For that, you'll load it in the HTML as you would for a website.
If this is still something that interests you there is a very early beta stage of CSSApply on github
Extremely lightweight skinning system for iOS. It allows you to load a
CSS file and skin UIView elements. The system also allows you to do
simple searches for subviews like jQuery with CSS selectors.