- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
谁能帮帮我?我正在为其使用 React Native Expo SDK 42,它仅在 Android 上显示此错误。我的 iOS 设备上没有错误。我尝试了所有方法,例如添加 Overflow: "hidden"但仍然没有用。
不知道这个错误发生在哪里。我认为它在投资组合部分,但我认为那里没有问题。
import { ScrollView, StyleSheet, Text, View } from "react-native";
import { StatusBar } from "expo-status-bar";
import { SafeAreaView } from "react-native-safe-area-context";
import StockListItem from "../components/StockListItem";
import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs";
const Home = () => {
const tabBarHeight = useBottomTabBarHeight();
return (
<SafeAreaView style={[styles.container, { paddingBottom: -tabBarHeight }]}>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={styles.contentContainer}
style={styles.scollContainer}
>
<View style={styles.portfolio}>
{/* Money */}
<View style={styles.moneyContainer}>
<View style={styles.invested}>
<Text style={styles.moneyText}>Invested</Text>
<Text style={styles.moneyNumber}>10,000</Text>
</View>
<View style={styles.current}>
<Text style={styles.moneyText}>Current</Text>
<Text style={styles.moneyNumber}>10,000</Text>
</View>
</View>
{/* Underline */}
<View
style={{
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
width: "90%",
}}
>
<View
style={{
flex: 1,
height: 2,
borderRadius: "50%",
backgroundColor: "#808080",
}}
/>
</View>
{/* Profit */}
<View style={styles.profitContainer}>
<View style={styles.profit}>
<Text style={styles.profitText}>P&L</Text>
</View>
<View style={styles.profitValue}>
<Text style={styles.profitNumber}>+10,000</Text>
</View>
</View>
</View>
<StockListItem />
</ScrollView>
<StatusBar style="light" />
</SafeAreaView>
);
};
export default Home;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#161616",
alignItems: "center",
justifyContent: "center",
},
scollContainer: {
width: "100%",
},
contentContainer: {
alignItems: "center",
justifyContent: "center",
},
portfolio: {
marginTop: 10,
height: 150,
width: "90%",
backgroundColor: "#242424",
borderRadius: 10,
overflow: "hidden",
alignItems: "center",
justifyContent: "center",
},
moneyContainer: {
flex: 2,
width: "90%",
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
},
invested: {
width: "50%",
},
current: {
width: "50%",
},
moneyText: {
color: "#808080",
fontSize: 18,
fontWeight: "500",
},
moneyNumber: {
color: "#ffffff",
fontSize: 24,
fontWeight: "500",
},
profitContainer: {
flex: 2,
width: "90%",
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
},
profit: {
width: "50%",
},
profitValue: {
width: "50%",
},
profitText: {
color: "#808080",
fontSize: 18,
fontWeight: "500",
},
profitNumber: {
color: "green",
fontSize: 24,
fontWeight: "500",
},
});```
最佳答案
尝试使用不带引号的 50 :
<View
style={{
flex: 1,
height: 2,
borderRadius: "50%", => borderRadius:50,
backgroundColor: "#808080",
}}
/>
另请注意错误,“java.lang.string cannot be cast to java.lang.Double”表示您将字符串 ("50%") 转换为 double(带点的数字,例如 1.0 )
边框半径应为数字 - https://reactnative.dev/docs/view-style-props#borderradius
关于reactjs - 更新由 : RCTView java. lang.String 管理的 View 的属性 'borderStyle' 时出错,无法转换为 java.lang.Double,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69517968/
我正在开发一个在网格中加载图像的 C# Winforms 项目,我实现了并行性和线程来了解它,但有些事情我无法弄清楚。我需要在运行时更改一组图片框的 BorderStyle,这是我的代码: Task.
我有一个面板 System.Windows.Forms.Panel 有属性 BorderStyle="FixedSingle" 它呈现灰色边框。 我需要: 能够设置边框的颜色和粗细(如果可能)。 我很
我想在具有最大化窗口状态的父窗体中打开一个子窗体。 我不想让用户最小化/最大化/关闭那个子窗口, 所以我为子窗口设置了 BorderStyle = None 并将 MaximizeBox 和 Mini
有谁知道我怎么写“cardImage1.BorderStyle = BorderStyle.Fixed3D;”无需明确声明“cardImage1”? 我试图将它放入一个方法中,这样我就不需要编写代码来
我想在 Compact Framework 3.5 中为标签和面板制作边框,但没有像 BorderStyle 这样的属性。我搜索和谷歌,但我不知道如何在紧凑的框架中为标签和面板制作边框。 最佳答案 s
我刚刚花了相当多的时间尝试在 GExperts 中使 Delphi 6/7 IDE 的“工具/环境选项”对话框变得相当大。一切似乎都工作正常,直到我发现将表单的 BorderStyle 更改为 bsS
如何在 JavaScript 中将渐变颜色添加到描边样式 Canvas 。请帮助我,我的代码工作完美,但问题只是我一直在尝试向笔划样式添加渐变颜色,但它只是破坏了我的代码。 任何人都可以帮助将这个渐变
当我将 System.Windows.Forms.ListView 放在 WinForm 应用程序(使用 C#/.NET 4.5)的窗体上时,它呈现为平面矩形,即使 BorderStyle 属性设置为
我使用 Apache POI 3.15。我最近切换到最新版本,我们现在有一些已弃用的方法,它们具有“短”边框样式、“短”对齐...对于这些已弃用的方法,我们有带有 Enum 参数的新方法(如 Bord
我换了一个 WinForms TextBox控制没有边界。 当我这样做时,框中文本的底部像素行被切断。 顶部: BorderStyle.Fixed3D (默认)。 底部: BorderStyle.No
这仍然显示纯边框样式。在经历了很多之后,我发现在某些情况下使用 borderRadius 会显示 borderStyle。但仍然 borderStyle 'dotted' 和 'dashed' 对它没
我正在Delphi XE8中开发Firemonkey应用程序,发现以下情况: 我需要以小窗体显示一个小网页,只有一个 TWebBrowser 控件,Align:=Client 且 Form Borde
我想显示/隐藏在 Excel 中使用的“Microsoft Forms 2.0 标签”的边框。 我可以手动将边框样式从 0 - fmBorderStyleNone 更改为 1 - fmBorderSt
我正在尝试删除 UISearchBar 中 UITextField 的 textborderstyle。我知道我正在获取对正确对象的引用,因为我能够将 TextBorderStyle 更改为 Roun
谁能帮帮我?我正在为其使用 React Native Expo SDK 42,它仅在 Android 上显示此错误。我的 iOS 设备上没有错误。我尝试了所有方法,例如添加 Overflow: "hi
我是一名优秀的程序员,十分优秀!