Skip to main content

android - Custom drawable on mapview -


rectangle.xml

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:layout_weight="100"> <solid android:color="#ffffff"/> <stroke android:width="3dp" android:color="#ff000000"/> <padding android:left="1dp" android:top="1dp" android:right="1dp" android:bottom="1dp"/> <corners android:radius="30dp"/> </shape> 

my map activity

//drawable d = getresources().getdrawable(r.drawable.chart); <-- drawn on map drawable rect = getresources().getdrawable(r.drawable.rectangle); // <-- wont overlayitems itemizedoverlay = new overlayitems(rect, this); 

could please explain why cant add custom shapes on mapview? normal png file works well, if try make custom shape , add it, wont appear. makes no sense me since theyre both drawables?

did miss obvious? thanks

android - custom drawable on mapview - stack overflow

learn, share, build

each month, on 50 million developers come stack overflow learn, share knowledge, , build careers.

join world’s largest developer community.

sign up

rectangle.xml

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:layout_weight="100"> <solid android:color="#ffffff"/> <stroke android:width="3dp" android:color="#ff000000"/> <padding android:left="1dp" android:top="1dp" android:right="1dp" android:bottom="1dp"/> <corners android:radius="30dp"/> </shape> 

my map activity

//drawable d = getresources().getdrawable(r.drawable.chart); <-- drawn on map drawable rect = getresources().getdrawable(r.drawable.rectangle); // <-- wont overlayitems itemizedoverlay = new overlayitems(rect, this); 

could please explain why cant add custom shapes on mapview? normal png file works well, if try make custom shape , add it, wont appear. makes no sense me since theyre both drawables?

did miss obvious? thanks

share|improve question
    
does rectangle.xml exist inside drawable folder? , not drawable-hdpi or others – hesham saeed jul 8 '12 @ 10:48
    
@heshamsaeed res/drawable/rectangle.xml. should in bin/res och res folder? have both in root – johan jul 8 '12 @ 11:30
    
folder called drawable inside res folder – hesham saeed jul 8 '12 @ 14:23

your answer

 
discard

posting answer, agree privacy policy , terms of service.

browse other questions tagged or ask own question.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -