Comments (14)
@magicismight This is June, 2018 and the snippet
<Line
x1={0}
x2={100}
y1={0}
y2={0}
stroke="black"
strokeWidth={2}
strokeLinecap="round" // < ---- doesn't work
/>
Doesn't work!
from react-native-svg.
We use strokeLinecap
instead of strokeCap
.
Because stroke-linecap
is a valid svg attribute not stroke-cap.
And it is supported on [email protected]
both android and iOS.
from react-native-svg.
strokeLinecap works fine on android.
You can try the example code.
import Svg, {
Path,
Rect,
G,
Defs,
Stop,
RadialGradient,
Polyline,
ClipPath,
Circle,
Text
} from 'react-native-svg';
<Svg height="80" width="225">
<G fill="none" stroke="black">
<Path strokeLinecap="butt" strokeWidth="8" d="M5 20 l215 0" />
<Path strokeLinecap="round" strokeWidth="8" d="M5 40 l215 0" />
<Path strokeLinecap="square" strokeWidth="8" d="M5 60 l215 0" />
</G>
</Svg>
Maybe you imported the elements from the old react-native-art-svg
instead of react-native-svg
?
from react-native-svg.
Which component did you used?
And the art
module issue is fixed by now,
Thx for reporting this to me.
I will release those fixes to npm by next Monday.
from react-native-svg.
Good find!
👍
Get it be fixed in last commit
from react-native-svg.
BTW
This package has changed name to react-native-svg
now.
And it is no longer based on ReactNativeART
from react-native-svg.
Hey thanks for the feedback. I upgraded to react-native-svg but had to manually install the "art" npm module. It's not very clear in the instructions that it is needed. Also I've made a pull request because patternReg.js was missing.
The linecaps are default to square now, but I'm still not able to change them with the <Line>
component. 😞
from react-native-svg.
Which react-native-svg
version did you installed?
And did you install by npm2? or npm3?
from react-native-svg.
[email protected] and npm2 (2.14.7)
from react-native-svg.
Oh it seems like Github omitted my <Line>
string from a previous comment, so I have to escape with code formatting... Anyway I tried using Path like you suggested and strokeLinecap works! So it seems the problem is that this property is not working for <Line>
component?
from react-native-svg.
It's the <Line>
component that has issues.
I'm glad to help, by the way great job on this package!
Here's an example:
<Line
x1={0}
x2={100}
y1={0}
y2={0}
stroke="black"
strokeWidth={2}
strokeLinecap="round" // < ---- doesn't work
/>
from react-native-svg.
I will fix this soon.
from react-native-svg.
This is Nov. 2023, with [email protected], the strokeLinecap="round"
still does not work for Line
or Path
from react-native-svg.
[email protected] still doesn't work. Any news?
from react-native-svg.
Related Issues (20)
- Path not rendering correctly HOT 1
- How to center Text along a path?
- React Native SVG stroke-width bug on expo web. HOT 4
- SVG image not import in React native HOT 3
- ForeignObject works with panResponder? HOT 2
- Why is `err` exported?
- stroke-width default value must be 1
- Error "ViewPropTypes" undefined in svg.js file HOT 1
- defaultProps issue with React version 18.3 HOT 4
- Comments in SVG file results in "Text strings must be rendered within a <Text> component." HOT 1
- Svg is blur on react-native-windows
- [Android] SvgFromUri doesn't work RN 0.74, New Arch + bridgelessMode ON. Jest tests failed. Patch is provided HOT 7
- Build failed on react-native 0.74.0 & newArchEnabled HOT 1
- ERROR Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider, js engine: hermes HOT 4
- Image gets tiled instead of centered. HOT 4
- <image> tag in Svg not rendering properly in iOS while it's working properly in Android/Web HOT 2
- C/C++ Problem with RN-SVG HOT 3
- wrong onPressIn callback called when rendering a list of shapes and using a pencil/stylus! HOT 2
- Add HTTP headers to <SvgUri> HOT 3
- [Bug] the hitSlop value should use float on android like on ios HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-svg.