android Gallery 两侧阴影实现

TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);
int mGalleryItemBackground = a.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 0);
a.recycle();         
ImageView image = (ImageView)findViewById(R.id.imageview);
image.setBackgroundResource(mGalleryItemBackground);
         
<resources> 
    
    <!-- These are the attributes that we want to retrieve from the theme
         in view/Gallery1.java -->
    <declare-styleable name="Gallery1">
        <attr name="android:galleryItemBackground" />
    </declare-styleable>    
</resources>
posted @ 2012-08-31 23:28  lipeil  阅读(921)  评论(0编辑  收藏  举报