react / react/react-native

Elevation and border radius do not work well with opacity from Android 9

Aperta
#25,093 32 commenti 46 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Bug Help Wanted :octocat: Platform: Android
Lingua principale
C++
Stelle
127k
Fork
25.3k
Merge medio
1g 23h
PR unite (30g)
4

Descrizione

The way elevation works is that it creates a border around the element that is then shifted to the bottom. The background color of the element then hides the inside part of the border.

When we apply border radius to the same element, the border gets thicker to accommodate for the increased radius. So far so good.

Unfortunately if we then apply the opacity to the parent, the background color of the element gets semitransparent, making the border visible and creating an ugly effect.

Screenshot_2019-05-30-17-03-34-477_host exp exponent

React Native version: 0.57
Expo SDK 32
Android version: 9.0

Steps To Reproduce

Create an element and apply, elevation, border radius and background color. Then apply opacity on its parent.

Describe what you expected to happen:

The border underneath the element should not leak out

Snack, code example, or link to a repository:

https://snack.expo.io/SJDAlu6TV

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia eseguendo l’Expo Snack collegato con React Native 0.57, Expo SDK 32 e Android 9, quindi riproduci la combinazione di elevation, border radius, background color e parent opacity. Il lavoro è completo quando il bordo di elevation non traspare più visibilmente attraverso lo sfondo semitrasparente e lo stile previsto rimane intatto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
android, react-native
Ambito
mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.