nine-patch

android 9-patch graphic doesn't scale in image view

点点圈 提交于 2019-12-02 18:36:56
I have <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/ImageView01" android:src="@drawable/phone80"></ImageView> <ImageView android:id="@+id/ImageView02" android:layout_height="wrap_content" android:src="@drawable/underline" android:layout_width="fill_parent" android:layout_gravity="fill_vertical|fill_horizontal"></ImageView> </LinearLayout> The first image is a fixed size image which

How to create 9 patch in Photoshop? What is 9.png encoding? [closed]

倖福魔咒の 提交于 2019-12-02 18:21:25
Provided utility looks bad, for example it does not allow to do "Save As", or to draw several button states with similar slicing. Is it possible to draw 9.png in photoshop? I noticed, that generated png just contains black pixels in outer edge. Is this what is marking the slices? What if black pixels present in two opposite edges, how does this work? Are outer edges cut off when displayed on android? Yes, I do all of my nine patches in Photoshop. Here are the basic rules for creating a 9-patch: The outer 1px margin can contain only 100% black (RGB 0, 0, 0) or fully transparent. The black

Android nine-patch content-border not honoured

烈酒焚心 提交于 2019-12-02 07:04:42
问题 I have a 9-patch image. I defined top left quadrant to be a content area, yet it is not honoured (see the preview on the right hand side of the screenshot). What am I missing? Thanks! 回答1: The content region is defined by the right and lower bars as mentioned above, but what you are really defining is the padding (top,left,bottom and right padding). The padding is set by counting the number of transparent pixels at the start and end of the right and lower bars. So the padding would be approx

convert bitmap into ninepatch to use as background

偶尔善良 提交于 2019-12-02 06:23:08
问题 I have a problem I've been stuck on for a few days. I am trying to convert a nine patch image into a bitmap array, and change a specific color to a different one. I am having trouble converting the bitmap back to a nine patch, so I can use it as a background for a layout. I have tried using this code to create the bitmap then convert it back to a nine-patch drawable, but it just starts the activity and blinks black then goes back to the parent activity. If I comment out the creation and

ListView With Nine-Patch Item Background Issues

血红的双手。 提交于 2019-12-01 23:38:23
WARNING: The XML in this question is wrong, read the answer before you confuse yourself! I have been banging my head on the wall for a while now. The following posts have shed light on the subject, but failed to solve my issue: Android ListView State List not showing default item background and ListView item background via custom selector The proper nine-patch background shows perfectly when I select the list item, but I can not get the default nine-patch background to show initially. It seems to me that I need to set the default item background somehow, but I can't figure out how to do so.

convert bitmap into ninepatch to use as background

China☆狼群 提交于 2019-12-01 23:27:00
I have a problem I've been stuck on for a few days. I am trying to convert a nine patch image into a bitmap array, and change a specific color to a different one. I am having trouble converting the bitmap back to a nine patch, so I can use it as a background for a layout. I have tried using this code to create the bitmap then convert it back to a nine-patch drawable, but it just starts the activity and blinks black then goes back to the parent activity. If I comment out the creation and initialization of the nine-patch the activity starts just fine. Bitmap backMap = BitmapFactory

my 9 Patch Image stopped working

為{幸葍}努か 提交于 2019-12-01 17:45:28
I have been using 9 patch images for a while now. But have come to an issue. The GUI designer in Eclipse tells me that the image works fine. And it looks how it should. However in the device it just stretches the image as if it were a normal png. The worst part is that it was working but then i did a Clean and Rebuild and I cannot seem to get the 9patch image working any more. My question is has anyone else encountered this issue. Is there some setting somewhere in the android compilation or in eclipse that would turn this off. I have opened the images in draw9patch.bad and they seem to be

How to resize images at runtime for different screens?

笑着哭i 提交于 2019-12-01 12:58:45
I know that in Android Studio there are some plugins for including a drawable that help in creating a ldpi, mdpi, hdpi, etc image resource. But suppose I have an app in which some users upload images to a server and then I download the images and display them for other users, how can I adapt them so that they adapt to ldpi, mdpi, hdpi screens? Is there a library that runs on the server or client? Pavneet_Singh there are two ways , either you do it or let other do it you can use picasso (image loading library ) with fit function and just relax . link find the required size and compress the

How to resize images at runtime for different screens?

泪湿孤枕 提交于 2019-12-01 11:27:50
问题 I know that in Android Studio there are some plugins for including a drawable that help in creating a ldpi, mdpi, hdpi, etc image resource. But suppose I have an app in which some users upload images to a server and then I download the images and display them for other users, how can I adapt them so that they adapt to ldpi, mdpi, hdpi screens? Is there a library that runs on the server or client? 回答1: there are two ways , either you do it or let other do it you can use picasso (image loading

9-patch drawable behaving badly, weird artefacts - what is wrong here?

守給你的承諾、 提交于 2019-12-01 10:47:54
so Im trying out the 9-patch images. I started out with a PNG-file where I have a semi-transparent square with rounded corners: Then, I created the 9-patch, like this (note the little dot on top and to the left): I thought that was enough to handle this, but when adding this 9-patch to Eclipse, I get weird results. Result nbr 1 Based on this XML: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearLayout6" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable