-1

I have developed an android app in android studio.I have used Buttons, TextView etc in xml layout and onclick and other functionality in java file.Now if there is css file,for styling the buttons,How I can access that css file.Please help me.

Amshu
  • 127
  • 10
  • http://stackoverflow.com/questions/18507351/how-to-create-custom-button-in-android-using-xml-styles – Antonios Tsimourtos Aug 08 '16 at 10:23
  • It doesn't work like that. An Android xml layout is not an HTML document (which uses CSS Styles). And it's also NOT STYLEABLE by an XSL file (not for using that in an app). You can use android styles and themes to style your app. – Phantômaxx Aug 08 '16 at 10:26
  • Ok. Whether it possible from using WebView or phonegap without changing java code. – Amshu Aug 08 '16 at 10:30
  • If you plan to develop a web page and use it in a WebView... then I wouldn't call it an Android app. And mind that from a web page you won't be able to interact with your device's peculiar features. You can interact with the Java code outside the WebView with some tricks. But then it would be harder to manage. – Phantômaxx Aug 08 '16 at 10:44
  • @ Rotwang In my application I am getting IMEI number of device and login and I am uploading profile image to the server,etc.For these I should design UI only using XML and Not possible using css right?I want to clarify this.Because I have done the functionality part of this app and UI is is doing by other person who is good in css.So I had this doubt. – Amshu Aug 08 '16 at 10:52
  • A CSS designer is in my opinion halfway between a graphic designer and a developer. But CSS doesn't apply to Android UI elements. – Phantômaxx Aug 08 '16 at 11:01
  • Ok. Thannk you so much for clearing my doubt :) – Amshu Aug 08 '16 at 11:03

1 Answers1

0

Not Possible. You can not apply css styles to android sdk component i.e. Button. You can design your own style i.e. drawable by making use of android standards which are defined by google. Already google has provided lots of properties for Button class. You can use that properties in activity through layout file or programmatically.

https://developer.android.com/reference/android/widget/Button.html

Mujammil Ahamed
  • 1,454
  • 4
  • 24
  • 50
Dnyanesh
  • 331
  • 3
  • 12
  • if you are satisfied then accept my answer – Dnyanesh Aug 08 '16 at 10:27
  • @ Dnyanesh In my application I am getting IMEI number of device and login and I am uploading profile image to the server,etc.For these I should design UI only using XML and Not possible using css right?I want to clarify this.Because I have done the functionality part of this app and UI is is doing by other person who is good in css.So I had this doubt – Amshu Aug 08 '16 at 10:53
  • so you can use hybrid platform instead of android native development. You can build your application by making use of hybrid platform like apache cordova or phonegap – Dnyanesh Aug 08 '16 at 12:41