Skip to content

Commit ceabc52

Browse files
committed
修改多媒体预览,左右切换按钮样式
1 parent c162f95 commit ceabc52

6 files changed

Lines changed: 34 additions & 1 deletion

File tree

1.33 KB
Loading
2.06 KB
Loading
2.97 KB
Loading

‎src/assets/publicTheme/common/index.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const icon_radio_unselected = require('./icon_radio_unselected.png')
1111
const icon_radio_unselected_disable = require('./icon_radio_unselected_disable.png')
1212
const icon_about_itablet_more = require('./icon_aboutitablet_more.png')
1313
const icon_back = require('./icon-back-white.png')
14+
const icon_next = require('./icon-next-white.png')
1415
const icon_close = require('./icon-close.png')
1516
const icon_album = require('./icon_album.png')
1617
const icon_rephotograph = require('./icon_rephotograph.png')
@@ -40,6 +41,7 @@ export default {
4041
icon_radio_unselected_disable,
4142
icon_about_itablet_more,
4243
icon_back,
44+
icon_next,
4345
icon_close,
4446
icon_album,
4547
icon_rephotograph,

‎src/components/MediaViewer/MediaPager.js‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
* 多媒体预览界面
33
*/
44
import * as React from 'react'
5-
import { View, Modal, Platform } from 'react-native'
5+
import { View, Modal, Platform, Image } from 'react-native'
66
import { checkType } from '../../utils'
7+
import { getPublicAssets } from '../../assets'
78
import Swiper from 'react-native-swiper' // eslint-disable-line
89
import styles from './styles'
910
import VideoViewer from './VideoViewer'
@@ -118,6 +119,22 @@ export default class MediaPager extends React.Component {
118119
index={this.state.defaultIndex}
119120
loop
120121
showsButtons={this.props.data.length > 1}
122+
prevButton={
123+
<View style={styles.arrowView}>
124+
<Image
125+
style={styles.arrowImg}
126+
source={getPublicAssets().common.icon_back}
127+
/>
128+
</View>
129+
}
130+
nextButton={
131+
<View style={styles.arrowView}>
132+
<Image
133+
style={styles.arrowImg}
134+
source={getPublicAssets().common.icon_next}
135+
/>
136+
</View>
137+
}
121138
>
122139
{this.getData()}
123140
</Swiper>

‎src/components/MediaViewer/styles.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,18 @@ export default StyleSheet.create({
179179
marginTop: 3,
180180
marginBottom: 3,
181181
},
182+
arrowView: {
183+
paddingHorizontal: 8,
184+
paddingVertical: 12,
185+
justifyContent: 'center',
186+
alignItems: 'center',
187+
backgroundColor: 'transparent',
188+
},
189+
arrowImg: {
190+
width: 40,
191+
height: 60,
192+
justifyContent: 'center',
193+
alignItems: 'center',
194+
backgroundColor: 'transparent',
195+
},
182196
})

0 commit comments

Comments
 (0)