Languages

Menu
Sites
Language
How to create a custom button

I want to create multiple buttons arranged in a row, each having a icon part and a text part. Contrary to normal button(icon and text are aligned horixontally) in tizen, I want to have the iocn being placed on top and text part would be beolw of it(you can say aligned vertically).

Is there any simple way to do it or known to any body?

Thanks in advance.

Responses

4 Replies
Jean Yang

Hello, 

I think the image button is the style you want, I list the code, you can try it:

/* btn_circle style */
    btn = elm_button_add(box);
    elm_object_style_set(btn, "circle");
    elm_object_text_set(btn, "circle twoline");
    img = elm_image_add(btn);
    elm_image_file_set(img, ICON_DIR"/icon.png", NULL);
    elm_image_resizable_set(img, EINA_TRUE, EINA_TRUE);

....

Michael Starc

Thanks for your answer, probably I wasn't clear enough.

My requirement is little different. I am looking for the button which looks like a box with visible border, embedding both parts. Upper part will be holding the image and lower part holding the text part.

I am unsure, if I can get the same done by some style settings.

Jean Yang

Hi, 

Do you mean you want to set the text part and button part in one container, and there is visable border between both part?  Or if you just want to set the text style, I think it's possiable.

Michael Starc

I mean by behavior it should be a button, but the appearance would be as I mentioned in my previous post.

In Adroid(ImageButton) its available, if you r a facebook user you can see such buttons in the the profile view on Android device.