如何画出完美的圆形按钮?

Mad*_*rai 4 android android-xml android-button

我想绘制一个完美的圆形按钮.我尝试使用以下代码:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval" >
    <stroke 
        android:width="3dip"
        android:color="#065a32" />
    <corners android:radius="10dip"/>
      <solid android:color="#eaebec" />
</shape>
Run Code Online (Sandbox Code Playgroud)

但即使我更改参数,我也只能绘制椭圆形状:

<stroke 
android:width="3dip"/>
<corners android:radius="10dip"/>
Run Code Online (Sandbox Code Playgroud)

我的截图:

在此输入图像描述

我已经尝试过这个网站的不同链接,但没有一个满足我的需要.

编辑:

我的getView()代码是:

public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        if (convertView == null) { 
            LayoutInflater vi = (LayoutInflater) mContext
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.calendar_item, null);

        }
view.setBackgroundResource(R.drawable.calendar_cell_clicked);
}
Run Code Online (Sandbox Code Playgroud)

rac*_*hit 8

使用这个xml

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

  <solid
      android:color="#eaebec" />
</shape>
Run Code Online (Sandbox Code Playgroud)

并在您设置后台使用的布局中

        android:layout_width="50dp"
        android:layout_height="50dp"
Run Code Online (Sandbox Code Playgroud)

或者你需要圆圈的任何尺寸.