0
A
回答
1
您正在使用的模塊? react-native-camera
或react-native-camera-kit
?
如果您使用react-native-camera
只需將View
(或Image
)放入相機組件中,然後添加樣式以垂直和水平對齊此視圖。
像這樣:
const styles = {
container: {
flex: 1,
},
camera: {
flex: 1,
// These below are most important, they center your border view in container
// ref: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
alignItems: "center",
justifyContent: "center"
},
borderImage: {
// Your styles for image, or custom borders
},
}
class Component extends React.Component {
...
render(){
return <View style={styles.container}>
<Camera style={styles.camera}>
<Image style={styles.borderImage} source={require("./img/qrBorder.png")} />
</Camera>
</View>;
}
}
相關問題
- 1. 如何在文本中添加邊框?
- 2. 如何在uiview中添加邊框?
- 3. 如何在相關佈局中添加底部邊框
- 4. 如何在Android中添加相機預覽框中的按鈕?
- 5. 在UIBarButtonItem中添加邊框
- 6. 在Java中添加邊框
- 7. 如何在TableLayout周圍添加邊框?
- 8. 如何在位圖上添加邊框
- 9. 如何在QWidget周圍添加邊框?
- 10. 如何在listview上添加邊框?
- 11. 如何添加邊框到表單框?
- 12. 如何在邊框周圍添加另一個邊框?
- 13. 如何在多邊形圖中添加邊框?
- 14. 如何在Swing中的組件邊框外添加邊距?
- 15. 添加邊框
- 16. Windows手機爲圖像添加邊框
- 17. 如何向表中添加標題,以及如何在php中添加邊框
- 18. 如何將邊界框附加到相機?
- 19. 如何在相機上添加UIView?
- 20. 如何在使用png的複選框中添加邊框
- 21. 如何添加2個div的單個邊框相鄰?
- 22. html添加邊框
- 23. 如何在opencv中爲圖像添加邊框,邊框顏色必須與圖像顏色相同
- 24. Fitgrid - 在列的邊緣添加邊框
- 25. 如何將邊框添加到OHAttributedLabel
- 26. 如何添加邊框的CSS
- 27. 如何倒轉添加邊框半徑?
- 28. Apache POI:如何添加對角邊框
- 29. 如何添加邊框到XWPFTableCell
- 30. 如何向表面添加邊框?
非常感謝你 –