2014-05-14 36 views
2

我已经创建了一组在Android 4.4完美地工作的形状: enter image description here 然而,当我测试2.3: enter image description here 底部角部被切换,并且它被冷凝(这可能是高度问题)。 因此我决定创建一个像drawable-v14这样的文件夹,并为不同的版本分配不同的形状,但我需要知道哪些Android版本存在缺陷。我无法在所有版本上测试它!的Android形状错误的Android版

EDIT
形状为按钮号7:

<?xml version="1.0" encoding="utf-8"?> 
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > 
    <item> 
     <shape android:shape="rectangle"> 

      <solid android:color="@color/rounded_stroke_color" /> 

      <corners 
       android:topLeftRadius="0dp" 
       android:topRightRadius="0dp" 
       android:bottomLeftRadius="@dimen/rounded_radius_default" 
       android:bottomRightRadius="0dp" /> 

     </shape> 
    </item> 
    <item 
     android:top="@dimen/rounded_stroke_normal_half" 
     android:bottom="@dimen/rounded_stroke_normal" 
     android:left="@dimen/rounded_stroke_normal" 
     android:right="@dimen/rounded_stroke_normal_half"> 
     <shape android:shape="rectangle"> 

      <solid android:color="@color/rounded_fill_color" /> 

      <corners 
       android:topLeftRadius="0dp" 
       android:topRightRadius="0dp" 
       android:bottomLeftRadius="@dimen/rounded_radius_default" 
       android:bottomRightRadius="0dp" /> 

      <padding 
       android:left="@dimen/rounded_padding_left" 
       android:right="@dimen/rounded_padding_right" /> 

     </shape> 
    </item> 
</layer-list> 

BTW的值被存储在不同的资源文件。

+1

我从来没有听说过类似的bug在android中。你可以发布你的绘图和布局文件。我想你错过了一些东西。我想你已经错过了填充(可以在Android 4.4中默认的风格中定义,但在Android 2.3中没有定义)。其他问题呢,我需要看到drawables和布局文件。 –

回答

2

好吧,让我们从你的代码开始。 首先,你不需要有层次列表。你可以这样做:

<shape android:shape="rectangle"> 

      <solid android:color="@color/rounded_stroke_color" /> 
      <stroke android:color="@color/comments_dark_color" android:width="@dimen/stroke_width"/> 
      <corners 
       android:topLeftRadius="0dp" 
       android:topRightRadius="0dp" 
       android:bottomLeftRadius="@dimen/rounded_radius_default" 
       android:bottomRightRadius="0dp" /> 

     </shape> 

没有问题的角落,你是对的。它被称为bug https://code.google.com/p/android/issues/detail?id=9161。此bug已被固定在安卓3.1

由于@DerGolem说,有黑客:

幸运的我们,有一个解决办法:解决方法是把 “正确” drawbles在绘制-V12文件夹和反向的 在可绘制文件夹中

+1

幸运的是,我们有一个解决方法:'解决方法是在drawable-v12文件夹中放入“正确的”可用文件,并在可绘制文件夹中放入“正确”的可用文件' –

+0

@DerGolem是的,您是对的。这个黑客也发布在链接上。 –

+1

是的,这是我把它从商店里拿出来的地方。 –