How do I theme a MonoTouch application? - xamarin.ios

I'm doing an MonoTouch application and I would like to apply a theme. (So I don't have to have go around and apply a custom color and style to each view background and button.)
Is there any easy way to do this? So should I be setting the color manually, and use a helper class to determine which color?
e.g.
_myButton.Color = ThemeHelper.GetButtonColor();

You may want to take a look at UIAppearance in iOS 5+. It allows devs to set styles for UI elements globally as in the following example:
UIButton.Appearance.BackgroundColor = UIColor.Blue;
For more info, here's a good blog post: http://tirania.org/monomac/archive/2011/Oct-14.html

Related

Adding User Defined Runtime Attributes?

Is there a way to add user defined runtime attributes to a button in Xamarin's storyboard designer?
I'm trying to get Pixate Freestyle to work and need to define the attributes. I can only find the place to define them within xcode.
I was working on a Xamarin Forms project and I figured out that on each platform, there is a method to update the style for a Control. The way I used to do this is something like this:
PixateFreestyle.SetStyleId(view, styleId);
or
PixateFreestyle.SetClassId(view, classId);
Where view is any UIView you want to style ann styleId/classId is a string with the style name in your default.css
Hope this works for you
This is where I based my project
XamarinForms-PixateFreestyle

Color fields in XPages

I have been working on a database in Lotus Domino Designer 8.5, specifically with XPages. I've noticed that I can include a field on a FORM as a color field, with a color picker, but the same functionality is not available within XPages. Basically, the person populating the document would pick a color (Green, Yellow, Red, or Blue), and I would like the field to show that color block. I am fairly new to Domino Designer, so I don't know if I'm missing something or some coding technique, but any advice or guidance would be helpful.
You can use new HTML5 input type of color.
<xp:inputText id="inputText1" type="color"></xp:inputText>
Note: It does not work in Internet Explorer.
I did something like this in an XPages "spreadsheet". Take a look at my blog article at http://www.teamspace.ca/TeamSpace/Blog.nsf/dx/using-xpages-to-develop-complex-reports-part-2.htm
You want to look at CSS.
You should create a stylesheet and then add that style sheet to the page as a resource. Then you simply apply that style to your resource. So you would set in the stylesheet how you want fields to look if they are black. Then you apply that style to any fields you want to have the same color. This allows you to change all fields at the same time by simply modifying the stylesheet, or having styles computed easily.
I will see if I can dig up some code for you.
I would stay away from the individual styling that Domino designer uses.
I did sth like this in an application using XPages and I used this one:
http://www.eyecon.ro/colorpicker/
Very easy to implement to a editbox control on an XPage.

How do I make rich:dataGrid responsive?

I'm looking for a way to make a dataGrid provided by richfaces responsive.
Meaning, the grid scales based on the size of the device screen.
I've taken a look at Richfaces Bootstrap : http://planet.jboss.org/post/richfaces_bootstrap
but they recommend not to use it in any production code since it is still under development. Tags and attributes are subject to change at anytime.
You'll need to overwrite the default CSS. Here is the list of classes that make up a dataGrid.
The responsivness is achieved by queries like this:
#media(min-width:768px) and (max-width:979px) {
/* styles for the given width range */
}
You shouldn't use the Bootstrap components but you can use the CSS. However the dataGrid is a table and those don't scale very well.

How to change Nokia full touch lwuit form header color

I want to to change the header color of nokia lwuit based full touch form and i have tried setTitleComponent method but it is not working. Please also check the following link
http://projects.developer.nokia.com/LWUIT_for_Series_40/wiki/UsingSeries40FullTouchFeatures
in which it is mentioned we cannot style the header but is it means we cannot change the bgcolor as well or put custom images in the header?
Note that when using LWUIT for Series 40 port, the default way of running LWUIT apps is a normal-size canvas in Series 40 full touch devices. Thus the Series 40 chrome shows on top of canvas. And there is no way of customising it (other than the title text).
If you want to provide branding elements to the title, the options are:
1. create an additional lable below the Series 40 headerbar
2. run the application in full-screen. We are planning to create a high-level API for this but currently it is already possible using the following trick:
((GameCanvas) (javax.microedition.lcdui.Display.getDisplay(this)).getCurrent()).setFullScreenMode(true);
In the latter option you will of course lose the Series 40 full touch layout.
Use lwuit source, you can change method visibility if required, this is example what i used to use gradient color
form.getTitleComponent().getStyle().setBackgroundType(Style.BACKGROUND_GRADIENT_LINEAR_VERTICAL);
form.getTitleComponent().getStyle().setBackgroundGradientEndColor(Color.GRADIENT_END);
form.getTitleComponent().getStyle().setBackgroundGradientStartColor(Color.GRADIENT_START);
form.getTitleComponent().getStyle().setFgColor(Color.WHITE);
form.getTitleComponent().getStyle().setPadding(10,10,0,0);
form.getTitleComponent().getStyle().setFont(font);
Here Color is my custom class that is used for color code, you can use your one.

QFileIconProvider always use "gnome" theme?

Is there a way to let user choose what icon theme to use , when using QFIleIconProvider ? It looks like Qt uses "gnome" by default , i wanted to change this behavior.
The icon style is dependent on what is returned from QApplication::style(). So if you change the application style using QApplication::setStyle(), you'll get a different set of icons too. If you want a different theme than the application style, you need to subclass QFileIconProvider and set you custom icon provider with QFileSystemModel::setIconProvider(yourCustomIconProvider).

Resources