borderStyle: 'dashed' doesn't work correctly
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C++
- Sterne
- 127k
- Forks
- 25.3k
- Ø Merge
- 1 T. 23 Std.
- Gemergte PRs (30 T.)
- 4
Beschreibung
Description
Dear Developers:
I am trying to control the style of View.
When 'Dashed' pressed, the style of View will be changed, especially the borderStyle will be set as 'dashed'.
The problem is, when I run this on iOS devices, the dashed border line and the solid border line are coexisted. It only appears when overflow is set as 'hidden'

Waiting for your answer : )
import React, { useState } from 'react';
import { Text, View, StyleSheet } from 'react-native';
const styles = StyleSheet.create({
item: {
width: 100,
height: 100,
borderWidth: 1,
borderColor: 'gray',
borderRadius: 4,
overflow: 'hidden'
},
addItem: {
width: 100,
height: 100,
borderWidth: 3,
borderColor: 'red',
borderRadius: 4,
borderStyle: 'dashed',
overflow: 'visible'
}
})
const HelloWorldApp: React.FC = () => {
const [st, setSt] = useState(styles.item)
return (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center"
}}>
<Text>Hello, world!</Text>
<View style={st}/>
<Text onPress={() => {
setSt(styles.addItem)
}}>Dashed</Text>
<Text onPress={() => {
setSt(styles.item)
}}>Reset</Text>
</View>
)
}
export default HelloWorldApp;
Version
0.66.00
Output of npx react-native info
I dont have any info because I reproduced this problem on reactnative.dev/docs/tutorial
Steps to reproduce
You can paste code here reactnative.dev, where I met this problem.
Run with iOS device and click the 'Dashed' Text, you will met same problem, I think.
import React, { useState } from 'react';
import { Text, View, StyleSheet } from 'react-native';
const styles = StyleSheet.create({
item: {
width: 100,
height: 100,
borderWidth: 1,
borderColor: 'gray',
borderRadius: 4,
overflow: 'hidden'
},
addItem: {
width: 100,
height: 100,
borderWidth: 3,
borderColor: 'red',
borderRadius: 4,
borderStyle: 'dashed',
overflow: 'visible'
}
})
const HelloWorldApp: React.FC = () => {
const [st, setSt] = useState(styles.item)
return (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center"
}}>
<Text>Hello, world!</Text>
<View style={st}/>
<Text onPress={() => {
setSt(styles.addItem)
}}>Dashed</Text>
<Text onPress={() => {
setSt(styles.item)
}}>Reset</Text>
</View>
)
}
export default HelloWorldApp;
Snack, code example, screenshot, or link to a repository
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der bereitgestellten View-Reproduktion und führe sie auf einem iOS-Gerät aus. Konzentriere dich dabei auf das Zusammenspiel von borderStyle, borderWidth, borderRadius und overflow. Das Issue ist abgeschlossen, wenn beim Wechsel vom solid zum dashed style kein sichtbarer solid border mehr zurückbleibt, wenn overflow auf hidden gesetzt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- ios, react-native
- Bereich
- mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 55/100