Making 9patch Images With Single Pixel Borders

Is there a trick to making 9patch images with single pixel borders?

I'm not talking about the single pixel black borders that you use to define the stretchable and content areas. I'm talking about the image itself. If i create an image that has a 1 pixel border around it, often times android will pick one of the edges and stretch it to 2 (or sometimes more) pixels, even though i specifically left the edges out of the stretchable area in the draw9patch utility.

Here is a screenshot of what i mean; in this screenshot i've got two buttons in a vertical linearlayout with the same background image. The top button obviously has a thicker border, though it shouldn't.

Here is a closeup of the screenshot button (on the left) and the actual 9patch image (on the right).


Buttons are not the only place i've seen this. If i create a background image with a 1 pixel border and use it as the background for listview rows, sometimes the border appears to be 2pixels instead of just 1.

It's hard to get a ui to look exactly how you want it with these problems. There's got to be a way to get it to appear how you think it should.

View Full Post With 1 Replies

Related Forum Messages:

Please Follow Index to Quick Jump to the Message.

Draw Borders For Textview Created Using Code Not By Xml In Droid

I created my textview through code rather than xml. I want to draw a border around the textview. How can we do this using code rather than xml? I also wanted when i try to settext for the textview which is of some 2 lines then textview is moving downward?

Posted On: Oct 13 at 10:10 . 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 .

Tabhost - Access A Single Activity Using 2 Different Tabs

I want access a single activity using 2 different tabs. For ex i have a single activity like people and two tabs those names are tab1 and tab2. When i click on tab1 i want to display the people page as my group and when i click on tab2 that same page displayed the show all title. That means i want to access a single intent for two tabs in the same way the information in that activity is displayed according to tab. For this purpose what can i do?Give me some suggestions.

Posted On: Apr 17 at 6:24 . View Related Posts . . View 2 Replies .

Testing Several Projects With Single Test Project

Is it possible to test several android projects by having only one test project? I've tried various ways like specifying several instrumentation tags: or played with the packages but finally i got only tests for one application working correctly, tests for the other applications are giving java. Lang. Verifyerror. All of the applications are signed with the same key.

Posted On: Aug 24 . View Related Posts . . View 4 Replies .

Htc Incredible - Way To Send A Single Picture And Have It Not Be A Slideshow

Is there anyway to send a single picture and have it not be a slideshow? When i try to send pictures to people without smartphones it says its unable to load content so i cant send them any pictures. Is there a way to send one as a single picture or can i just never send my friends photos anymore?

Posted On: 10-30-2010, 06:52 PM . View Related Posts . . View 3 Replies .

Way To (programatically , Xml) Add Various Shapes To A Single Drawable

I need to put 3 shapes (circles) on a drawable. I will create various drawables with different colors and use it on an animation, the problem is i cant find a way to (programatically or xml) add various shapes to a single drawable.

Posted On: Apr 27 2009 . View Related Posts . . View 8 Replies .

Single App For Email Messages From Gmail, Yahoo

Just got the galaxy g2, coming from blackberry 9700. Other than missing the message notification led on the outside of the case (noled app just isn't the same), what i loved about the bb is that all my messages, sms, gmail accounts, yahoo accounts, pop3, etc, were queued up in a single messages application. Other than socialhub, which seems to do that, but which doesn't look so good, is there a way on this phone to do that?

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

Add Two Map Tangs In Single Xml File In Droid

I am creating tab bar in my application. For one tab i set map activity as tab spec content and add overlay on it. Now i have to move on next map as user clicks on overlay.
In short i have to create two layouts each on has map and at run time i have to set visibility and one after other.
For that i create one xml layout which has linear layout as root layout and then create two separate relative layouts to hold two maps but it gives me error that unexpectedly closed.

Posted On: Aug 12 at 11:39 . View Related Posts . . View 1 Replies .

Htc Droid Eris - Clear Logon Information For A Single Web Page

I inadvertently entered the wrong user id on a web site, then told the eris to remember the logon information. Now that incorrect user id and password show up every time i go to that page.

Is there a way to clear this information for that page without clearing all saved passwords for all the other sites for which i have saved user id and password information?

Posted On: 10-20-2010, 11:21 AM . View Related Posts . . View 3 Replies .

Getting Error Frequently When Making Httpconnection / Cause Of It

I am getting this error frequently when making httpconnection.

Sometimes it connects and sometimes not.

I have tried with various link. It behaves same with all.

What may be the cause? Code.

Posted On: Oct 11 . View Related Posts . . View 4 Replies .

Layout - Making Three Tables With One Column

I need to represent the following diagram: each x will be an image button. I was thinking of making three tables with one column each and have each cell height be half the height of the table. The problem is that the table needs to be able to stretch or shrink because i am worried about getting everything on the screen and the tables are the only part that can change size and have the entire thing still look ok. The problem i am having is that the rows are only as big as the image buttons. While all the image buttons are the same size, the left and right table in particular, need to have some padding around the image buttons to make it alright. I would add margins to the buttons but that defeats the reshaping problem i am having. I think.

Posted On: Nov 5 at 18:32 . View Related Posts . . View 3 Replies .

Making Your App Available To 3rd Party Applications

I want to integrate my application with 3rd party application, my understanding is that both application can agree of a action which can be used in intent filter for any activity to be exported which could be used when 3rd party app fires the intent with that particular action in it, any body has a better approach to this.

Posted On: Aug 12 at 23:56 . View Related Posts . . View 1 Replies .

Motorola Droid - App Specifically Designed For Making Schedule

I recently switched from a long line of windows mobile phones (which i liked the features of but obviously wasn't a huge fan of the bugs) and i have always used excel to make the work schedules for my employees. It's fast, easy, and simple to email to everyone if they can't remember when they work next.

I just picked up the droid yesterday and as far as i can tell there is no excel (which makes sense) i did notice a few spreadsheet programs on the market but haven't tried them yet. Does anyone know of an app specifically designed for making a schedule? Something basically like a spreadsheet where i can have rows with names and columns with days and times.

I'm going to download one of the spreadsheet programs now and see what i think but if anyone has any suggestions i am definitely open (and interested) in trying something new.

Posted On: 11-09-2009, 12:17 AM . View Related Posts . . View 2 Replies .

Htc Hero - Root Phone Without Downgrading And Making Goldcard?

Have got htc hero on 3 contract and wanting to root, is there any way i can do this without downgrading and making goldcard.

Build number is 2. 73. 771. 62

Posted On: 05-08-2010, 05:37 AM . View Related Posts . . View 1 Replies .

Motorola Droid X - App / Something For Making Video Calls On Phone

Is there a good app or something out there for making video calls on the x?

Posted On: 08-30-2010, 04:59 PM . View Related Posts . . View 3 Replies .

Htc Desire Hd - Phone Making Clicking Noise / This A Common Fault

I'm not sure if my new htc desire hd is faulty, when i go into message mode and begin to type out a text it vibrates as you touch the buttons which i know is normal but now sometimes i hear a clicking noise as i push the different letters, not sure what to do, is this a common fault? Should i send the handset back?

Posted On: 11-01-2010, 03:36 PM . View Related Posts . . View 3 Replies .

Sprint Htc Hero - Phone Not Making A Peep / Make It Sound

So i have been using my phones 16gb memory card to listen to music on my computer at work for most of the day today. I go out to lunch and bring the phone with me as usual. I notice that i have 5 missed calls and 9 texts that have come in over the last few hours. My phone did not make a peep and i now realize why, with the memory mounted via the computer the phone has no access to the memory where the ringtones are stored and thus the phone has no way to make sound.

Posted On: 10-29-2009, 03:38 PM . View Related Posts . . View 7 Replies .

Motorola Droid - Overclocking Making Phone Run Hot All Of A Sudden / Fix This

I was fine running 7. 1, then i updated that rom to 7. 3, and since then any beast rom has made my battery temp run in the 104 range.going back to a beauty rom, it settles back down under 97and lower. What's that all about?

Posted On: 02-11-2010, 01:46 PM . View Related Posts . . View 20 Replies .

Can't Get Widgets From Main.xml Referenced In Java Program / Basic Mistake Am I Making

Made a very basic xml file to try and access a simple button widget. The main.xml file is code.

The error on the 'button' line is:
Button01 cannot be resolved or is not a field

Any ideas, what very basic mistake am i making.

Posted On: Sep 24 at 22:32 . View Related Posts . . View 1 Replies .

Motorola Milestone - Latency Being Extremely High - Making Browsing Ect Over Wi-fi Feel Slower Than Over Hsdpa

I've had my motorola milestone for just under a week now and although an excellent handset, i like others, am experiencing some wi-fi problems , usually just refusing to communicate (although still apparently connected), this is resolved by turning wi-fi off in the handset, and then back on again.

But the main problem is latency being extremely high, usually around 800ms but up to 1400ms, making browsing ect over wi-fi feel slower than over hsdpa.

The latency was determined by pinging the handset from a wired ethernet computer from the command prompt.

I upgraded from android 2. 0 to 2. 0. 1 over the air hoping that it would resolve the problem, which it didn't, and then to 2. 1 from and developers, but the problem still persists.

I've also tried pinging my ipod touch, which produced a time of around 250ms and my samsung galaxy portal (android 1. 5) which had also had a latency of around 250ms.

So it would seem that the problem is inherent to the milestone rather than android handsets in general?

I'm using a us robitics 5450 802. 11g access point, and the signal strength is good. Pinging the access point itself from a wired ethernet computer produced a latency of less than 1ms, and i do not have any issues with any other wi-fi connected devices on my network.

I've yet to attempt pinging my milestone from a different wi-fi ap.

Has anyone else her had similar latency issues, and have you had any luck resolving the problem?

Posted On: 04-08-2010, 04:53 PM . View Related Posts . . View 1 Replies .

Get Zoom Functionality For Images

Is there a common way to show a big image and enable the user to zoom in and out and pan the image?

Until now i found two ways:

Overwriting imageview, that seems a little bit too much for such a common problem.
Using a webview but with less control over the overall layout etc.

Posted On: Mar 29 at 10:36 . View Related Posts . . View 4 Replies .

Webview Wait For Images

When using webview to load a page that has a number of images, the images seem to appear one a time as they are available. This happens even if the images are cached. This tends to give the user more of a "browser" type of experience rather than an "app" type of experience. Does anyone know if there is a way to make webview wait until all of the images are rendered before displaying the entire page?

Posted On: Apr 22 . View Related Posts . . View 3 Replies .

Insert Images In Edittext Programatically

I have to insert images(smiley) in the edittext programatically . I am not able to find any api for the same.

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

Images In Listview In Wrong Places

I have a listview which has rows that include an imageview.

I am populating the imageview with the following code (getting the image from the sdcard if available):


And the rows are populated with information from the database through the wrapper. The textviews in the rows show up fine, but the imageviews seem to have random effects.

I'm not really understanding the process of populating an imageview in the row or why the imageview doesn't know which row to populate with the image.

Posted On: Jun 9 . View Related Posts . . View 7 Replies .

Listing Different Images Along With Text In Droid

In my app i want to list both the images and text. I want to list different images. So please help me to resolve this issue.

Posted On: Oct 13 at 10:45 . View Related Posts . . View 2 Replies .

Sending Images Using Http Post

I want to send an image from the android client to the django server using http post. The image is chosen from the gallery. At present, i am using list value name pairs to send the necessary data to the server and receiving responses from django in json. Can the same approach be used for images (with urls for images embedded in json responses)?

Also which of, accesssing images remotely without downloading them from the server or downloading and storing them in a bitmap array and using them locally is a better method? The images are few in number (<10) and small in size (50*50 dip).

The images chosen from the gallery are sent to the server after scaling it to required size.

Posted On: May 29 at 17:19 . View Related Posts . . View 5 Replies .

How To Get Hdpi Images To Not Look Like Autoscaled Versions

How do i get my hdpi images to not look like autoscaled versions? Do i need to make the pixels per inch special or something? I use gimp and i've tried everything and my images still look terrible. I don't know what property i have to change to make it work. Right now i have my ppi set at 72. Also i don't know if this matters but the images are 9patch images. Also, i am using the hdpi button image straight from the hdpi source folder, and it also looks like crap when using . Setbackgroundresource(r. Drawable. Imagename).

The weird part about the button image is that it looks just fine when it's set via xml as the background resource, but when it's reset using . Setbackgroundresource, it looks like ***. Please tell me what i am doing wrong.

Posted On: Jul 3 . View Related Posts . . View 2 Replies .

Can't Switch Images / Just Text

I have need of a button that will change its image from one drawable to another based on whether it is toggled on (not just when pressed). I believe to do this i would extend compoundbutton and add images, or extend imagebutton and implement checkable, with custom attributes for onsrc and offsrc.

The current togglebutton extends textview and not imagebutton, so you can't switch images, just text. I just wanted to make sure i hadn't missed something where this is already doable with the standard views.

Posted On: Mar 16 . View Related Posts . . View 4 Replies .

How To Cite / Reference Free Images

I am about to release my first app on the market for free. How should i reference or give citations to images i have used in my app. I have used two images which are free images available at http://commons.

Posted On: Jul 31 . View Related Posts . . View 4 Replies .