Hey guys I am having trouble with placing my buttons in my XML layout. I already have a background and was just trying to put 3 buttons near the middle and thats where I'm having trouble. I know about center gravity and all that but could you help me? Also, If I made my own buttons can I just import them using the image button thing, or is that not right? Thanks for the help!
PS: Also, there is a big white box around my button. How do I get that to go away?
I posted this answer to your duplicate question, so I'll also post it here. :)
You can rearrange elements of your layout by editing the XML directly or by dragging and dropping in the outline view or the graphical layout view (I find the latter harder to do reliably).
To use your custom views, click on the "Custom & Library Views" button in the graphical layout palette, or just type in the fully qualified class name as the view tag in the XML.
If you use Image button you can set your custom Image to src property or background property. If youi chose src you should add android:background="#null".
But I would recommend to use background property while if you use 9-patch png (who knows maybe tomorow you will use 9-patch) they would not stretch if you set it in src.
Related
I am looking for a custom component to design a circular remote control view like the image below with different button and background color.
Each button should be touchable with proper press effect. I did find a useful library with this I am able to create somewhat similar design but still there are lots of improvement required like Press effect/ Inner and outer circle padding radius etc. Please help me to find the better option for this.
I think tihs is your answer.
You can download here.
https://code.google.com/p/radial-menu-widget/
You could make your own class extending view. You will then be able to override onDraw() and draw whatever you want.
You could also use default android Button with a custom xml selector defined with a different image ressource for pressed/not pressed states.
So lets say I have a segmented circle image asset inside an 'ImageView' widget, and I want to use each segment of that circle as a clickable surface to bring up a fragment with an image and some info.
Is there any way to build transparent arrangeable borders that I can use to do this with?
I'm using android studio with the default NavigationDrawer activity if that helps.
Maybe adding some ImageViews with transparent images on top of each section and making them clickable? That's how I'd do it. Of course this won't cover perfectly the area but it may work for what you need it.
So I found this. In case it can be of help to anyone else:
https://github.com/anupcowkur/Android-Wheel-Menu
Hi,
I want to design the buttons like the image above. eight button in a circular way. I am confusing how to design them in a circular to cricket logo.
I have tried it using relative layout and linear layout but can not make like this.
Please help me to make this view possible to implement.
Check out the Wheel Component which shows the circular views with the scrolling layout.
You can also download the reference demo HERE.
EDITED:
Check out other similar demo HERE and HERE
I have an EditText view which I need to look like below (focused and non-focused versions).
Also I have two following images:
Can I somehow just set these images as a background to make EditText look like above, not depending on its width? Or do I need to create some additional image files? Or some other solution? I'm a complete newbie in designing UI, so I'd appreciate any help and any comments on subject.
You first need to create a 9-patch graphic for each of your images. These specify how the image is stretched, and how the content is padded.
Then, you need to create a selector xml drawable to use one image or the other, based on the EditText state.
I am getting stuck with making android screen layout same like i have in my iPhone application. The iPhone screen layout is given in below image. Please anyone can help me out to make same screen for android. You can give me some idea with having some code snippet please.
Thanks in advance.
First off, you should be creating an XML-based layout. The Android SDK has a graphical layout tool that will help you with that.
Start looking into 9-patch images for your custom button graphics and setting your android:background attribute to them within a <Button />. Make sure you use actual text for the buttons, not graphics of the text. You should probably use a <RelativeLayout /> for the main layout, as that will let you target multiple screen sizes easily without a mess of nested <LinearLayout />s.
For the tinted area, just use a translucent PNG (with an alpha channel) instead of attempting to line up graphics.
use relative layout to design this screen like use image for navigation bar and align it as parent top (use no title bar in mainfest) add its listener
similarly you can align other text and image view