Can we use CSS in Android forms for Android components?

In any case, use css for android controls, and we can create classes for similar controls.

Thanks Atif

+8
java android android-layout android-widget
source share
3 answers

Why do you want to define CSS for Android views? First let me know the answer to this question, otherwise I would like to tell you that you can define the same styles inside the styles.xml file, and then you can implement it 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 the initial level, you encounter some difficulties, but later, when you become aware of the definition of the xml layout file, you will easily define styles for different views.

Update:

According to your comment below, I can say that you no longer know about styles and themes in android, so I would like to offer you links below to find out about styles / themes that will be applied in android.

+12
source share

Perhaps you can try Nativecss . This is a library where you can use css-like selectors in android layout.

--------- Updated on May 10, 2015 -----------

Or a whole new way to write an application, NativeScript

+4
source share

you can define β€œStyles and Themes,” but if you want to use CSS, you need an HTML form that you can display in your own Android WebView (the idea of ​​which mobile phone network platform works)

+1
source share

All Articles