Can we use CSS in Android forms for android components?
is there anyway to use css f开发者_运维百科or android controls, and can we make classes for similar controls.
Thanks Atif
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.
Update:
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.
- http://developer.android.com/guide/topics/ui/themes.html
- http://android-pro.blogspot.com/2010/08/using-themes-and-styles-in-android.html
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
you can define Styles and Themes, but if you want to use CSS you need a HTML form which you can show in a Native Android WebView (an idea on which phonegap platform runs)
精彩评论