is there anyway to use css for android controls, and can we make classes for similar controls.
Thanks Atif
It's a libary that you can use css-like selectors in android layout.
First, create an Android Application Project in Eclipse. Then open the Layout XML file. Drag the first Linear Layout then WebView Element to the Relative Layout of the Activity. Then make a HTML and CSS file.
The Short answer: Yes, you can develop apps using HTML / CSS / Javascript.
Create and apply a style To create a new style or theme, open your project's res/values/styles.xml file. For each style you want to create, follow these steps: Add a <style> element with a name that uniquely identifies the style. Add an <item> element for each style attribute you want to define.
Why do you want to define CSS for the Android views? First let me know the answer of this question, otherwise i would like to tell you that you can defines the same kind of styles inside the styles.xml file and then can implement for any views inside the xml layout file.
For example:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CodeFont" parent="@android:style/TextAppearance.Medium">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#00FF00</item>
<item name="android:typeface">monospace</item>
</style>
</resources>
At initial level, you face some difficulty but later on as you became aware about defining xml layout file, you will be used to define styles for different views easily.
As per your comment below, i can say you are not knowing much more about styles and theme in android, so i would like to suggest you below links to know about styles/theme to apply in android.
Maybe you can try Nativecss. It's a libary that you can use css-like selectors in android layout.
--------- Updated on May 10th, 2015 -----------
Or a completely new way to write app, NativeScript
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With