Comments (13)
@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.
Related Issues (20)
- `translateY` isn't working in react-native-web
- `Module parse failed` error when building for Storybook for web
- React Native Svg Linear Gradient Not loading when redirecting to bottom navigation tab HOT 1
- [Error: Expected > (0:110). If this is valid SVG, it's probably a bug. Please raise an issue HOT 3
- toDataURL only works the second time it is executed in old Arch HOT 1
- [Invariant Violation: requireNativeComponent: "RNSVGSvgView" was not found in the UIManager. HOT 7
- onPress in Path don't works on iOS, on android works
- The onPress method in the Path component works on android but not on ios.
- Svg Image pointerEvents="none" not working on Android
- Invalid `RNSVG.podspec` file: undefined method `visionos' for #<Pod::Specification name="RNSVG">. HOT 11
- Invariant Violation: requireNativeComponent: "RNSVGPath" was not found in the UIManager. HOT 2
- Fatal Exception: java.lang.Error Invalid number formating character 'N'
- SvgUri can not load some of the svgs in both android and ios
- Animating the strokeDashArray prop of an animated Path crashes running on the Android Simulator
- <Text /> with PanResponder only works if you click exactly on the letters
- Failed parsing SvgCssUri for first time, after reopening app it appears
- Xlinkhref only work on web does not work on ios and android (the color did not get inherited ) HOT 2
- React native web + vitest issue - Cannot use import statement outside a module HOT 4
- fetchText method error : TypeError: Cannot read property 'prototype' of undefined when trying to call svg from uri
- HTML entities contained in an XML string are not decoded by the SvgXml component
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.