When I tried to run the app from Xcode(10.1) then getting the following error.
logging.h not found.
Run Code Online (Sandbox Code Playgroud)
It's working fine while running an app in Android.
react: 16.8.3 => 16.8.3
react-native: 0.59.8 => 0.59.8
Node: 8.11.4
Yarn: 1.16.0
Xcode: 10.1
Run Code Online (Sandbox Code Playgroud) 我试图打开预览但无法打开它。
我已经尝试再次打开工作室,但预览只显示一个空白的白色屏幕,里面没有显示任何内容。当我再次打开它时,它在预览端显示以下消息:
A successful build is needed before the preview can be displayed
Run Code Online (Sandbox Code Playgroud)
构建过程已完成并尝试构建多次,但仍显示相同的错误。
我在里面使用了简单的文字。
@Composable
fun Greeting(name: String) {
Text (text = "Hello $name!")
}
Run Code Online (Sandbox Code Playgroud)
这是我的全部内容:
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Greeting("Android")
}
}
@Composable
fun Greeting(name: String) {
Text (text = "Hello $name!")
}
@Preview
@Composable
fun PreviewGreeting() {
Greeting("Android")
}
}
Run Code Online (Sandbox Code Playgroud)
如果有人知道这个问题,请分享答案。
使用自定义画家绘制形状时,在将最后一个点与第一个点连接时删除锐边/角度的问题。
我正在尝试使用 CustomPainter 创建自定义形状。我使用一些点创建了路径。对于绘制路径,我使用贝塞尔曲线。我的代码如下。但是当最后一个点连接到第一个点时,它会产生锐角。我怎样才能避免它?
// preparing path points for shape.
for (int i = 0; i < steps; i++) {
borderPoints.add(BorderPoint(xPoint, yPoint, radian, randomRadius, MovementDirection.INWARD));
}
borderPoints.add(borderPoints[0]);
// here, we are creating path for our shape.
jellyPath.moveTo(borderPoints[0].dx, borderPoints[0].dy);
int i = 1;
for (i = 1; i < borderPoints.length - 2; i++) {
var xc = (borderPoints[i].dx + borderPoints[i + 1].dx) / 2;
var yc = (borderPoints[i].dy + borderPoints[i + 1].dy) / 2;
jellyPath.quadraticBezierTo(
borderPoints[i].dx, borderPoints[i].dy, xc, yc);
}
jellyPath.quadraticBezierTo(borderPoints[i].dx, …Run Code Online (Sandbox Code Playgroud)