2

How can I create buttons like the "ABN Amro Bankieren" application for the Netherlands with onclick handlers?

Screenshot ABN Amro app

1 Answer 1

4

You have to make 2 pressed and normal (it may be 4 for focused and disabled) xml layout for each 3 top, center and bottom buttons. This is example xml for the center button for normal state is

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#F7FCF6"/>
    <stroke android:width="2sp" android:color="#9FA89F"/>      
</shape>

to make it rounded corner you may use corner tag for top button

<corners android:bottomLeftRadius="0.1sp"
android:bottomRightRadius="0.1sp" android:topLeftRadius="7sp"
android:topRightRadius="7sp" />

this may cause problem in xml layout editer but will be fine on emulator or real device

Sign up to request clarification or add additional context in comments.

2 Comments

damn, if i have to create at least 2 xml documents for all the buttons, that destroys my folder structure :') and with <stroke android:width="1px" android:color="#9FA89F"/> I set 1px border all around.. but how can I add a border just on the sides?
Then better is to add 9 patch Images of the button and you can achieve you desired.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.