-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImagesDemo.js
58 lines (51 loc) · 1.45 KB
/
ImagesDemo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React, {Component} from 'react';
import {View, Text, Alert, Image, TouchableOpacity} from 'react-native';
//Path: /home/kartik/Downloads
let path =
'https://media.npr.org/images/podcasts/primary/icon_759509341-ea66e15656eebe4bb8e5e5697c4b944566af8a68-s800-c15.jpg';
// '/home/kartik/Downloads/Motive1.jpeg';
export class ImagesDemo extends Component {
// componentDidMount = () => {
// console.log('Called');
// Alert.alert('hello world ');
// };
render() {
return (
<View style={{flexDirection: 'column'}}>
<TouchableOpacity
style={{height: 110, width: 110}}
onPress={() => {
Alert.alert('Image Alert');
}}>
<Image
style={{height: 100, width: 100, borderRadius: 50}}
resizeMode="contain"
source={{
uri: {path},
}}
/>
</TouchableOpacity>
<View style={{height: 200, width: 200, backgroundColor: 'lightblue'}}>
<Image
style={[
{
height: 100,
// width: 100,
borderRadius: 50,
},
{width: 300},
]}
// resizeMode="repeat"
source={{
uri: path,
}}
/>
</View>
{/* <Text>hello my name is kartik </Text> */}
</View>
);
}
}
/* Question :
when we use {{ }} double brackets and { } single brackets
*/