1.链接

https://github.com/Devlight/ShadowLayout

  

2.效果

android 给imageView,文字等加上阴影[记录]

 

3.code

compile 'com.github.devlight.shadowlayout:library:1.0.2'

  

 <com.gigamole.library.ShadowLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:sl_shadow_angle="2"
        app:sl_shadow_color="#000"
        android:
        app:sl_shadow_distance="5dp"
        app:sl_shadow_radius="1dp"
        app:sl_shadowed="true">
        <ImageView
            android:layout_width="100dp"
            android:
            android:layout_height="100dp"
            android:src="@mipmap/menu_stick" />
    </com.gigamole.library.ShadowLayout>

  

        final ShadowLayout shadowLayout = (ShadowLayout) findViewById(R.id.sl);
        shadowLayout.setIsShadowed(true);
        shadowLayout.setShadowAngle(45);//阴影角度
        shadowLayout.setShadowRadius(20);//阴影半径
        shadowLayout.setShadowDistance(30);//阴影距离
        shadowLayout.setShadowColor(Color.DKGRAY);//阴影颜色

  

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2022-03-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2021-04-27
  • 2021-12-24
相关资源
相似解决方案