ShadowViewHelperAndroid 阴影视图
ShadowViewHelper 是 Android 的阴影布局。
xml:
<LinearLayout android:id="@+id/activity_main_shadow_view_b" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="32dp" android:orientation="vertical" android:gravity="center" android:padding="8dp" > <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@mipmap/ic_launcher" /> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:text="Shadow View with LinearLayout" android:textSize="15sp" /> </LinearLayout>
Activity:
ShadowViewHelper.bindShadowHelper( new ShadowProperty() .setShadowColor(0x77000000) .setShadowDy(ABTextUtil.dip2px(context, 0.5f)) .setShadowRadius(ABTextUtil.dip2px(context, 3)) , findViewById(R.id.activity_main_shadow_view_b));
评论