Custom Buttons - How To Get Border/edge/frame When Read The Background From Xml

Using android shapes in xml i have defined a gradient which i use as the background for a button. This all works nice, but there's no edge surrounding the button. I would like it to look similar to the normal android button but i need more flexibility to control the color and look.

The shape is defined as follows:


I would expect the border to be set in the xml. Why doesn't "stroke" fix it? Stroke doesn't seem to do anything. I checked the android developer spec, but couldn't find the answer there:

I have also looked through all the properties of the android button, but as expected there's no such parameter, probably since it's built into the normal android button. Btw, i checked image-button properties too. I know there's the alternative to make an image with proper edges and use an imagebutton, but there really should be a way to fix this pro grammatically.

View Full Post With 2 Replies

Related Forum Messages:

Please Follow Index to Quick Jump to the Message.

Remove Custom Button Border

I used this selector code for my custom button (simple.xml) code.

But on my imagebutton i don't know how to remove border. I want to show only my images not to show border around button.

Posted On: Sep 27 at 11:02 . View Related Posts . . View 2 Replies .

Design Custom Border For Imageview Used In Gallery

How to design custom border for the imageview used in gallery?

Posted On: Oct 7 . View Related Posts . . View 2 Replies .

Read Xml From Web In Java

I have a given url with specific ids. I'm suppose to pass those ids to this url as argument and retrieve the xml in java. Any clue?

Posted On: Nov 5 at 7:13 . View Related Posts . . View 3 Replies .

Motorola Droid - How To Upload Custom Background

I've connected my droid to my pc, and dropped the png image i made onto the removable disk folder in my computer. But how do i find it on the droid and set it as a background now?

Posted On: Dec 25, 2009 3:25 PM . View Related Posts . . View 10 Replies .

Android -read A Particular Value In Droid Manifest File / Xml In Phone

Lets us assume that i am using service or database path in my application, so whenever i change the location path, i don't want to edit in all the ton times in coding. So is it possible to store the value in some xmlfile or manifest file and read it directly to a variable? Or i have to use xml parser? Any idea?

Posted On: Nov 19 at 20:14 . View Related Posts . . View 2 Replies .

How To Use Custom Android Viewgroup In Xml

I have a class that extends framelayout called noteview. It is a top level public class.

It works just fine when i'm creating the ui from java code, but i can't figure out how to use it in xml. I tried inserting the fully qualified class name just like i would for a custom view, but i get and exception classcastexception: android. View. View cannot be cast to android. View. Viewgroup when activity tries to inflate the xml.

I have only been able to find tutorials on custom views, not custom viewgroups. What do i need to do to use a noteview just like i would a framelayout in an xml layout?

For example: this works


But this throws the above exception:


Posted On: Jul 10 at 18:53 . View Related Posts . . View 1 Replies .

Referring To Ressources In Custom Xml

I have a multilingual android app, where i have put the different translations in the strings.xml in the respective directory.

Now i also have a custom xml file, where i would like to reference texts like this:


Now when i read the title attribute in my code, i obviously get the unresolved string "@+string/localizedtext" like it is.

Is it possible to somehow resolve this link to the localized text automatically?

Posted On: 2 days ago . View Related Posts . . View 2 Replies .

Htc Hero - No Market - Not Getting An Edge Connection

Im not getting an edge connection either (im in us with eu hero)

So what do i do from here? I just want it smooth with market installed.

Posted On: 12-23-2009, 02:47 PM . View Related Posts . . View 20 Replies .

Can't See The Edge Network Icon After Update From 2.1 To 2.2 On Galaxy S

Hey i have successfully update my samsung galaxy gt i5800l 2. 1 to 2. 2 froyo, i'm currently on a edge network. Before the update i was able to see the edge icon or the 'e' to signify that i was connected to the network but now am not seeing that since the update from 2. 2. I lost my free internet because of that any ideas?

Posted On: February 20th 2012 . View Related Posts . . View 1 Replies .

Game Loop / How To Control Speed And Frame Rate

I've written a game for android, and i've tested it on the dev phone 1. It works perfectly, the speed is just right. However, i'm sure phone cpu's are getting faster. They may already be faster than the dev phone. How do i make sure that my game runs at the exact same speed no matter what the device or how fast it runs? Do you know of any techniques? Should i check some kind of timer at the top of the loop each time?I guess i'm referring to frame rate - but mostly the speed at which my game runs through the main game loop.

Posted On: Feb 15 at 9:56 . View Related Posts . . View 1 Replies .

Motorola Cliq/motoblur - Edge Of Screen Touch

So i didn't really realize this until the latest update said one of the issues they had corrected was edge of screen sensitivity. Then i thought about it some more and i swear the "end call" button (which i always had issues with sensitivity) has moved from being at the bottom of the screen to above the num pad, mute and speaker. And now i'm having difficulties when i try to press the num pad, mute and/or speaker (since they've moved to the bottom)is anyone else having this issues? 

The fact that they've "moved" the end call button rather then truly fix the edge of screen issues leads me to believe this is a hardware issue with regards to touch sensitivity around the edges of the screen? Can anyone else comment?I have one of the original cliq's do the newer one's have the same issue?

Posted On: Apr 18, 2010 8:29 PM . View Related Posts . . View 3 Replies .

Source Code Not Working - Reading Frame Buffer Through Glreadpixels

I am new to android development and have an assignment to read frame buffer data after a specified interval of time.

I have come up with the following code:


Also, if some one can direct me to better way to read the framebuffer it would be great. I am using android 2. 2 and virtual device of api level 8. I have gone through many previous discussions and have found that we can not know read frame buffer directly throuh the "/dev/graphics/fb0".

Posted On: Jun 8 at 11:14 . View Related Posts . . View 1 Replies .

Convert Raw Frame Buffer Pixel Data To A Bitmap?

I am trying to convert a byte array containing raw frame buffer pixel data (height 480 * width 320 * bytes per pixel 2 ) in to a bitmap. To do this using bitmap. Setpixels, which needs an integer array of colors, i need to convert the 2 byte (rgb_565) data for each pixel in to an integer. This is expensive since it needs to be done for (480*320) pixels.

Is there a more efficient way of doing this conversion?

Posted On: Jun 8 2009 . View Related Posts . . View 2 Replies .

Php Xml Response Aftersax Parsing - Xml Or Text Declaration Not At Start Of Entity

I need to parse this php xml response in android:


Posted On: Feb 24 at 15:30 . View Related Posts . . View 1 Replies .

How To Set A Border Around An Image

Preferably, i'd like a somewhat fancy bevel . I'd like the picture to have some depth on it. So it doesn't look so plain and old-fashion.

Posted On: Feb 17 at 10:03 . View Related Posts . . View 1 Replies .

Removing Imageview Border

I have a vertically oriented linearlayout that has a child linearlayout that includes a textview, an edittext, and a button, and a child imageview.

So something like:


And the problem i am experiencing is that the seperation between the linearlayout and the imageview (displaying a .png as a background with android:background="@drawable/sun") is displaying a visible crease in between them. I have the linearlayout using the same background color as the .png so that it looks like they flow together, but the crease ruins that aspect.

Edit: here's a screenshot!

Do you see the thin line under the submit button?

Here is the xml:


How can i fix this? (My sun and cloud have rough edges, any quick fixes with gimp?)

Posted On: Nov 16 at 7:07 . View Related Posts . . View 1 Replies .

Gridview Image Border

I am using gridview for display group of image from xml using xml parsing now i want to display the border around each image in gridview. All image should display outline border on image in gridview . How to set boder for each image in gridview.

Posted On: Aug 20 at 13:44 . View Related Posts . . View 1 Replies .

Specify A Border Color For An Imageview When It Focus

In android, how can i specify a border color for an image view when it has focus? e.g. How to put an orange border around an image view when it has focus?

Posted On: Aug 3 2009 . View Related Posts . . View 2 Replies .

How To Display Border Lines For Tablelayout

Android developer guide mention "tablelayout containers do not display border lines for their rows, columns, or cells. " But we have a requirement to display the border on ui, there is no attribute to enable the border in tablelayout.

Posted On: Mar 13 2009 . View Related Posts . . View 3 Replies .

Set Different Color Of Border Of Rectangle Using Stroke

How about, if just to get top border or left border using stroke. Is it possible to set different width for different borders

Posted On: Oct 11 at 22:32 . View Related Posts . . View 1 Replies .

Htc Desire - Unlevel Screen - Border

The other day i was reading a few stories via the bbc news app and i thought the text appeared to be "slanting" from right to left. I'm not referring to the letters theirself, but more the direction the text was heading in.

I put it down to my eyes being tired or the angle i was holding the phone at.

However, i've since expected the phone very closely (a little too closely perhaps!) And it seems that the right hand side of the black "border" surrounding the screen is slightly thicker than the left hand side. This could obviously give the impression of slanting text at times in the direction i experienced.

I suppose i should note that the above is all extremely minimal and hardly noticeable. I just wanted to know if anybody else had noticed this.

Posted On: 06-17-2010, 07:22 AM . View Related Posts . . View 3 Replies .

Htc Hero - White Border Around Album Art?

I'm not sure if this a mp3 or hero issue, but some of my album art has a white border around it in the music app.

I've checked the actual art and it has no border, and i've tried resizing it to 300x300, 400x400 and 500x500 with no luck. The art on other albums is fine though. I'm using a freeware mp3 tagging tool to tag the art.

Posted On: 08-26-2009, 09:35 AM . View Related Posts . . View 2 Replies .

Sony Ericsson Xperia X10 - Way To Change Blue Border

You know the blue status bar that is normally white on most android phones, is there anyway to change its colors? Would be nice to have it in black.

Posted On: 04-28-2010, 06:21 PM . View Related Posts . . View 3 Replies .

Custom Views In Listview - Custom View Be Made To Fill The Entire Width Of The List View

This app is building custom views for elements of a list view. How can the custom view be made to fill the entire width of the list view?

This xml for the elements view is inflated from this:


Posted On: Sep 14 2009 . View Related Posts . . View 2 Replies .

Buttons Conditioned By Supported Parameters

I'd like to create a list of buttons that depend on device supported parameters ; for example, if the device's camera supports setting white balance and antibanding, then 2 corresponding buttons are displayed to allow the user to changes these settings; but if i run the same app on a device that supports only setting for white balance, then only one button is displayed.

I know how to create a list of buttons in the layout .xml file and i know how to test for supported parameters in the activity . Java file, but i don't seem to find a way how to link these together.

Here are the relevant pieces of my code so far:


Layout .xml file


Posted On: Sep 10 at 5:44 . View Related Posts . . View 1 Replies .

Motorola Droid X - Can Customize Buttons

Anyone know if we can customize the buttons. For instance the camera button is great if the screen is on, but simply bumoing the camera button while the screen is off will wake the phone. Same with the volume buttons. Id prefer to only wake the screen with the power button. Am i missing the settings or is it not possible?

Posted On: 09-13-2010, 05:29 PM . View Related Posts . . View 2 Replies .

Change Features Of Buttons Dynamically

I am really new to android development. I was working on event handling and using the onfocuschange events to change features of other views in the activity.

For example, i make the text on edittext objects change as focus changes from one to the other. Similarly, i tried changing the text property of button objects and when run on the emulator, it simply says that program has stopped working.

I can't find relevant information to solve this puzzle for me. I am dead sure that it is when i attempt to change any feature of button objects that i get encounter this problem.

Posted On: Sep 13 . View Related Posts . . View 3 Replies .

Can You Get Samsung Galaxy S2 (at&t) Version With Only Three Buttons?

Title says it all, can you get the at&t version with only three buttons without buying the international version.

Posted On: January 1st 2012 . View Related Posts . . View 2 Replies .

Reasonable Way To Create Evenly-spaced Buttons

Please excuse the crude photoshop job. But this image should show pretty succinctly what i'm trying to do:

In a nutshell, i want the buttons evenly spaced along the height of my screen, and i'd like them to be all the same size. Is there a reasonable way to do this?

Posted On: Aug 7 at 8:49 . View Related Posts . . View 3 Replies .