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>
原文地址:https://www.cnblogs.com/lipeil/p/2666183.html