nine-patch

Creating Nine (9) Patch png files with Gradients

白昼怎懂夜的黑 提交于 2019-12-24 01:12:51
问题 I want to create a nine patch button background with a gradient for my android app. I was wondering how gradients work. I would think that the os would have to figure out how to apply the gradient as the button stretched and I'm guessing that information (a graphic vector equation) is not available in the 9 patch file? So is there a solution for this problem? Also, what about dithering, etc. I have created a few nine-patch button backgrounds, but none of them have a gradient. yet. Thanks in

Android 4.2 9-patch background drawn differently than older OS versions

十年热恋 提交于 2019-12-23 03:21:41
问题 I have a Nexus 7 with Android 4.2.1 and I noticed in my app the background image I am using for some linear layouts is drawn incorrectly. With other devices with older versions of the Android OS the 9-patch background is drawn correctly but with this device the border line is stretched when it should not be stretched. Correct (Evo 4G v2.3.5): http://i.imgur.com/WDTNr.png Incorrect (N7 v4.2.1): http://i.imgur.com/HntMY.png Any idea what is causing this? If not, is there any other way to get

Android 4.2 9-patch background drawn differently than older OS versions

帅比萌擦擦* 提交于 2019-12-23 03:21:30
问题 I have a Nexus 7 with Android 4.2.1 and I noticed in my app the background image I am using for some linear layouts is drawn incorrectly. With other devices with older versions of the Android OS the 9-patch background is drawn correctly but with this device the border line is stretched when it should not be stretched. Correct (Evo 4G v2.3.5): http://i.imgur.com/WDTNr.png Incorrect (N7 v4.2.1): http://i.imgur.com/HntMY.png Any idea what is causing this? If not, is there any other way to get

Draw 9 patch dotted /dashed line on Android

空扰寡人 提交于 2019-12-23 03:04:32
问题 Google doesn't help me find a solution of my problem. (As far I was looking for...). I want to know if it's possible to draw a dotted line with 9 patch capabilities on Android. My goal is to draw a dotted line from a layout to another one. I thought about 9 patch because I want the dotted line to be the same in every Activities. (not to be stretched). Is that possible ? Or maybe is there a better solution ? Here an example (with a solid line) of what I would like : http://hpics.li/866bb56

Ripple effect drawable is distorted when applied over 9patch background

混江龙づ霸主 提交于 2019-12-22 10:54:39
问题 I have a 9 patch drawable which I want to use as a background on a view. I want the view to show a ripple effect that follows the outline of a 9 patch when the view is clicked. Here's my activity, layout, and drawable code. MainActivity.kt: class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val click = findViewById<ConstraintLayout>(R.id.container) click.setOnClickListener {

Broken default backgrounds, like for EditText or pressed state in TabLayout and Toolbar

二次信任 提交于 2019-12-22 05:54:10
问题 I use TabLayout like tabs for ViewPager. When I pressing some tab I get background with strange color of tab. And independently of TabLayout EditText background also in strange view. This result in API 19. And in API 22 all work perfect When I press back button in toolbar I have similar background with strange color There is fragment xml where I use TabLayout and Toolbar <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http

Fully transparent activity with 9 patch corner image

倖福魔咒の 提交于 2019-12-21 21:57:59
问题 In my activity I try to make it transparent and with a 9 patch corner design , but it still showing a black color at the corner there, anyone know how to get rid of it ? What I try to do here is Non transparent (normal) Activity A with start a new transparent activity B as shown as below image but the 9patch background with corner design not fully transparent. Here's my 9patch Activity XML <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res

How to use 9 patch images in android for different-2 densities(like mdpi,ldpi,hdpi).?

空扰寡人 提交于 2019-12-21 02:54:53
问题 I am creating an android application in which I want multiple screen support.For these I have used 9 patch images. But my question is this whether using 9 patch images will be enough for different-2 density's devices or I will need to create different-2 9 patch images for varying densities(like mdpi,ldpi,hdpi). Thanks in advance 回答1: I recently found out myself in the same situation so let me pitch in and expand on what has been said already... Yes, 9-patch images will scale, that's what they

Android / 9-patch PNG: What, if I need smth like a 11-patch PNG?

我只是一个虾纸丫 提交于 2019-12-20 11:53:01
问题 In Draw 9-patch, everything looks fine. However , my SDK says the 9-patch png is malformed. Because I have something like an 11-patch png. Because I don't want the little grabbing area to be scaled. How to get it working? The screenshot describes everything: Error Meassage in Console: ERROR: 9-patch image /res/drawable-hdpi/top_complete.9.png malformed. Can't have more than one marked region along edge. Found at pixel #10 along bottom edge. ERROR: Failure processing PNG image /res/drawable

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

南笙酒味 提交于 2019-12-19 10:27:49
问题 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"