2014-02-24 20 views
0

我試圖用環形創建幻燈片按鈕,可繪製文件夾形狀正常工作的Android 2.xx的,但不同的Android 4.XX

rounded_cell.xml:

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
android:innerRadius="0dp" 
android:shape="ring" 
android:thicknessRatio="2" 
android:useLevel="false" > 

<solid android:color="#FFFFFF" /> 

<size 
    android:height="15dp" 
    android:width="15dp" /> 

<stroke 
    android:width="1dp" 
    android:color="@color/l_blue" /> 

</shape> 
+0

變化機器人:形狀= 「橢圓形」 等下提。 –

回答

1

第1步:製作一個你的「drawable文件夾」中的button.xml。

第2步:添加下面提到的代碼。

<shape xmlns:android="http://schemas.android.com/apk/res/android" 
android:shape="oval"> 

<solid android:color="#FFF" /> 
<stroke android:width="1sp" 
    android:color="#FF0000"/> 

步驟3:它應用到按鈕

+0

我試過你的代碼,但結果是一樣的。 Android 2.3.3工作正常。但Android 4.2.2的結果是有更大的圈子。我該如何解決? – tsomone

+0

在所有可繪製的文件夾(即drawable-hdpi,drawable-ldpi,drawable-mdpi,drawable-xhdpi,drawable-xxhdpi)中複製和粘貼這個xml文件,它對我的​​應用程序工作正常 –

+0

我無法解決這個問題,在這裏是結果https://www.dropbox.com/s/dkncrr1a8taqtft/image.PNG第一個是android 2.3.3,第二個是android 4.2.2 – tsomone

相關問題