0

다음은 ImageView에 적용 할 gradient.xml입니다. Lollipop API에서 기울기가 작동하지 않습니다. 21

<shape xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shape="rectangle"> 
    <gradient 
     android:angle="180" 
     android:endColor="#BF000000" 
     android:startColor="#00000000"/> 
</shape> 

는이 게시물을보고했다 - Android Gradient on Lollipop not working. - API 21을하지만, 내 문제는, 메신저 방사형 그라데이션을 사용하지 않습니다. 그러므로 내 XML 파일에 gradientRadius를 포함하지 않아야합니다.

쉽게 해결할 수있는 방법이 있습니까?

아무 것도 작동하지 않는다면 새로운 비트 맵을 만들고 그 위에 그라디언트를 적용한 다음 ImageView [그 추함]를 설정하는 방법을 생각하고있었습니다.

도움이 될 것입니다.

답변

0

나는 동일한 문제가있었습니다.

"ImageView"를 "FrameLayout"에 삽입하고 모양을 적용했습니다. 예를 들어 나는이 당신을 도울 수 있기를 바랍니다

<FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:foreground="@drawable/gradient"> 
    <ImageView 
      android:id="@+id/image" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"/> 
</FrameLayout> 

:

를 들어

관련 문제