2012-11-30 3 views
3

하나의 게임 앱을 만들고 있습니다. 그 응용 프로그램에서 한 동전은보기를 통해 이동해야합니다. 그러나 나는 그것을 어떻게하는지 모른다.타원형 모양으로 점을 그리는 방법

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
android:shape="oval" > 
<gradient 
    android:angle="135" 
    android:centerColor="#C4A5A5" 
    android:endColor="#875050" 
    android:startColor="#875050" /> 
<stroke 
    android:width="1dp" 
    android:color="#781A1A" 
    /> 
</shape> 

그리고 내 UI는 다음과 같습니다 :

내 코드는

enter image description here

나는이 이미지를 동전을 이동하려는.

답변

0

사용이 코드 ........

RoundRectShape rs = new RoundRectShape(new float[] { 15, 15, 15, 15, 15, 15, 15, 15 }, null, null); 
    ShapeDrawable sd = new ShapeDrawable(rs); 


    Button btnlogin = new Button(NativeCosmosActivity.this); 
    btnlogin.setBackgroundDrawable(sd);// this line converts Button to Ovel shape.. If you increase value 15 to 30, 
// you will get more Ovel shape. 
관련 문제