Comments (6)
@hmachaharywork Can you share your code here?
from react-native-cardview.
Sorry, I was away so couldn't reply. I cannot share the original code, but I have created a sample code. I was using RN 0.38.1 in my project. Thought it was due to the version of react native but after testing the below code with RN 0.44.2, found out that its not the version. Solved some problem from here .
But couln't solve the problem below.
import React, { Component } from 'react';
import CardView from 'react-native-cardview';
import { AppRegistry, StyleSheet, Text, View, TouchableOpacity } from 'react-native';
export default class testing extends Component {
constructor() {
super();
this.state = {
data: [
{id: 1, addr: "Hello"},
{id: 2, addr: "Hi, Nice to meet you"},
{id: 3, addr: "Hello, Nice to meet you too."},
{id: 4, addr: "How are you?"}
]
}
}
deleteData(id) {
let filteredData = this.state.data.filter((item) => {
return item.id !== id;
})
this.setState({
data: filteredData
})
}
renderData(data) {
return data.map((item) => {
return(
<View key={item.id} style={{flexDirection: 'row', paddingTop: 5}}>
<View style={{flex: .6, paddingLeft: 10}}>
<Text>{item.addr}</Text>
</View>
<TouchableOpacity
style={{flex: .2}}
onPress={() => this.deleteData(item.id)}
>
<Text>Delete</Text>
</TouchableOpacity>
</View>
)
});
}
render() {
const {data} = this.state;
return (
<View style={styles.container}>
<CardView
style={{paddingBottom: 20}}
cardElevation={2}
cardMaxElevation={2}
cornerRadius={5}
>
<View style={{width: 300}}>
<View style={{padding: 5,borderBottomColor: '#e3e3e3', borderBottomWidth: 1,}}>
<Text style={{fontSize: 16}}>User Information</Text>
</View>
<View>
{
this.renderData(data)
}
</View>
</View>
</CardView>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
});
AppRegistry.registerComponent('testing', () => testing);
from react-native-cardview.
@Kishanjvaghela have you found the solution for the above issue?
from react-native-cardview.
@hmachaharywork
I have fixed your issue. Please use the latest version now
"react-native-cardview": "^1.0.4"
Here is your demo output
from react-native-cardview.
@hmachaharywork You can find example here
from react-native-cardview.
@Kishanjvaghela Thanks for the quick fix. Appreciate your hard work.
from react-native-cardview.
Related Issues (20)
- Typescript issues
- Task :react-native-cardview:verifyReleaseResources FAILED HOT 4
- Unable to use cardview HOT 1
- how to use custom shadow color HOT 4
- Not working with react-native 0.60 in Android, AndroidX HOT 2
- Not working in IOS. through an error. HOT 1
- Release Build failed HOT 3
- Task :react-native-cardview:verifyReleaseResources FAILED HOT 2
- Support for Autolinking HOT 1
- Replace obsolete 'compile' with 'implementation' HOT 2
- Negative Margin for children not working on android. HOT 3
- Error in importing HOT 1
- Could not find a declaration file for module. HOT 1
- i am put index.d.ts to project of react-native root directory, but notice is not found file of type declare HOT 2
- TouchableNativeFeedback doesn't show any animation if applied to CardView
- how to set only top shadows?
- Invariant Violation: Text strings must berendered within a <Text> component. HOT 1
- how to add onPress / onCLick listener on cardview?
- Shadow is not showing in left and right when we give marginHorizontal or paddingHorizontal to the parent
- Add react-native-web support
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-cardview.