Shape drawing - issue with corners

by Smiley » Tue, 25 Jan 2011 20:58:19 GMT


Sponsored Links
 Hi,
I am following the instruction here:
 http://developer.android.com/guide/topics/resources/drawable-resource.html 

and I am trying to draw a rectangle with only 2 rounded corners.

Here is my xml

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

        <corners android:radius="15dp" android:bottomRightRadius="0dp"
                 android:bottomLeftRadius="0dp" />
        <gradient android:angle="90" android:startColor="#c45209"
                android:endColor="#edb18c" android:centerColor="#ea6814" />
</shape>

I tried many variations, with or without the android:radius attribute
but no luck.
Any suggestions?
Thanks,
Lior

-- 



Re: Shape drawing - issue with corners

by Kostya Vasilyev » Tue, 25 Jan 2011 21:30:45 GMT


 Lior,

Apparently, something like this works a little better:

<corners
android:topLeftRadius="15dp"
android:topRightRadius="15dp"
android:bottomRightRadius="0.1dp"
android:bottomLeftRadius="0.1dp" />

-- Kostya

25.01.2011 15:58, Smiley :
Hi, I am following the instruction here: http://developer.android.com/guide/topics/resources/drawable-resource.html and I am trying to draw a rectangle with only 2 rounded corners. Here is my xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android=" http://schemas.android.com/apk/res/android" ;> <corners android:radius="15dp" android:bottomRightRadius="0dp" android:bottomLeftRadius="0dp" /> <gradient android:angle="90" android:startColor="#c45209" android:endColor="#edb18c" android:centerColor="#ea6814" /> </shape> I tried many variations, with or without the android:radius attribute but no luck. Any suggestions? Thanks, Lior
-- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com --


Sponsored Links


Other Threads

1. Recognizer not present

I am using Antroid 2.2 and using Voice API sample application .

 setContentView(R.layout.main);
        Button speakButton = (Button) findViewById(R.id.Button01);
        mList = (ListView) findViewById(R.id.List);
        PackageManager pm = getPackageManager();
        List<ResolveInfo> activities = pm.queryIntentActivities( new
Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);

        if (activities.size() != 0) {
                speakButton.setOnClickListener(this);
                }       else {
                        speakButton.setEnabled(false);
         speakButton.setText("Recognizer not present");
         }


I am always getting "Recognizer not present" .Do I need to do special
configurations to enable this feature ?


Regards, Anil

-- 

2. problem with tab view

hi could u tell me how to work with tab view in my list view
actually i developed one tab application.
But i want ,i select the expandable list . in that place(means  insted
of list items ) i keep my tabs
 how?
pls send total code
waiting for ur reply

-- 

3. Convert .JPG image to .PNG

4. Nested ImageButtons overlayed on top of one another

5. Android SDK Addon wrong rotation

6. SyncAdapter questions: monitoring sync status; getting sync settings; sync icon

7. Child View events in adapter for gallery