RubyMotion RMQ default global styles - ios

I'd like have default styles for UIViews.
Let's say that I want to have ALL UILabel with backgroundColor of color.light_gray.
Moreover I want to style my custom UIViews, e.g. for EVERY AttributedUILabel I want to have kerning value set to 2.
How to resolve that in RMQ?

In your RMQ application, you should have an ApplicationStylesheet class from which all your other stylesheets should inherit.
You could add a default_label method in this ApplicationStylesheet:
def default_label(st)
st.background_color = color.light_gray
end
To apply the style you would have to use it when you append your label
rmq.append UILabel, :default_label
Same goes for your AttributeUILabel, create a method in your ApplicationStylesheet and use the style when you append it to the view.
I suggest you go back to the RMQ stylesheets documentation, it shows everything you need to know about styling.

Related

How to customize ant design pro top navigation

I want to customize the top navigation bar. I was only able to change the title from config.js.
I want to resize the logo, increase the height of nav, put space between menus and title. Can someone point me to the file I need to modify?
I can't show the real logo and full title. But, I think you will get the idea.
You could use a .less file on inline css. Or even css. What I do is change in global.less for global change in antd classes. For component use a less file, like this, <Table className={styles.table}/>

Customize TextInputLayout with hint inside TextInputEditText

I'm trying to customize my TextInputLayout to make it like this:
I already tried lots of things using xml attributes but with style="#style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" but no success, the hint is always at border level with that space(like the default material).
It's possible to achieve this layout only using the TextInputLayout attributes or I'll have to create a custom view? If so, how would I control the hint animation?

jQueryUI button with multiple styles on single page

I'd like to use several buttons on single page, but I want to have one group which has one style (e.g. red color) and other one with different style (e.g. gray background and red forecolor).
Is it somehow possible?
Yes you can. The way to do this would be to use the css scope option when downloading the ui - http://jqueryui.com/download/
Simply include the framework, and the include both stylesheets with the different styles. Make sure to apply different css scopes (e.g. .light-style and .dark-style).
Next, in your html, whenever you show the buttons, add the appropriate CSS scope to the parent element so that the correct style is picked up.
You can also manually combine the two stylesheets so that you save space. This is assuming you only want the two differing button styles only.
Read the theming section here: http://api.jqueryui.com/button/
You can always add extra class to change the style. So after calling button() on an element, you can:
$(element).removeClass("ui-button-text");
$(element).addClass("ui-button-text-2");
and of course you need to define your own CSS class for this:
.ui-button-text-2 { color: red; }
This is of course clumsy, because you need to use two calls instead of a single button() call. But jQuery can be extended - you can simply create a $.themedbutton() method that accepts extra parameters...

How to set a border on a Vaadin component?

I would like to programmatically set a border around a Form component in Java. How can I do this without having to edit the css style sheet?
You could wrap the form with a Panel component, which has a border defined already. Otherwise, not much alternatives than just using CSS.
One option, if you wish to stay inside the server environment, is to use the CSSInject add-on and add the border using that (you still need to write CSS, but you can do it on the server in a Java file and not inside a regular CSS file).
Vaadin Flow — Style::set to specify CSS
In Vaadin Flow (Vaadin versions 10 and later), you can conveniently set CSS for a widget or layout programmatically. No need to edit separate CSS files, even though styling with CSS files is the recommended way.
On your widget/layout, call getStyle to retrieve the Style object.
On that Style object, call set to pass the name and value of your CSS property.
For example, I find setting a bright colored border on my nested layouts quite helpful for debugging.
myVerticalLayout.getStyle().set( "border" , "6px dotted DarkOrange" ) ;
You can see this in action with this screenshot on my Answer to another Vaadin question here:

Changing background color of jquery-ui button?

I'm using jquery-ui for buttons. The default theme looks great, but I'd like to apply a different background color to a few specific buttons. Is there a way I can easily add another css class to my buttons to just change the bg color of them, without changing any other properties of the button?
Thanks
Just add it to the button's HTML and when the button is created it will get all of the existing classes.

Resources