Convert PsD file to android xml

  • Replies:1
  • OpenNot stickiedUnanswered
  • Forum posts: 1

Mar 29, 2016 8:33:39 AM via Website

how to convert psd to android xml?

  • Forum posts: 1

Mar 29, 2016 11:26:13 AM via Website

It is really simple as the way you have done it for HTML. Everything is same except that you have to write CSS in the xml. There are things called wrap content, fill parent and so on. You should use them in a proper way. for examle if you have a button with a gradient background in your PSD, then slice it and use a ImageButton and assign the sliced image to the image button. Even the text, just get the color, size.. and look for something at XML which does that. Take a look at below code.
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />

The LinearLayout will arrange its children single column or a single row. Now its a single column because orientation is vertical. If you do it horizontal then its a row. Similarly, have a look atRelativeLayout which is similar to relative positioning in html. To change the background you can use android:background="color value here". There are no technical limitation here. You will get padding and margin as well. Just start with the xml layout. Do it by observing the PSD. I am sure your CSS experience will rock. All the best.