它是C语言.它写成:
typedef struct __attribute__((packed, aligned(4))) Ball {
float2 delta;
float2 position;
//float3 color;
float size;
//int arcID;
//float arcStr;
} Ball_t;
Ball_t *balls;
Run Code Online (Sandbox Code Playgroud)
请告诉我它是什么意思,以及如何使用这个关键字.
我的科特林代码是
val t = cameraController.getCharacteristicInfo(myDataset[position])
if (t is Array<*>) {
holder.keyValue.text = Arrays.toString(t)
} else {
holder.keyValue.text = t.toString()
}
Run Code Online (Sandbox Code Playgroud)
它不起作用。if (t is Array<*>)总是会回来false。
该函数的代码getCharacteristicInfo为:
public <T> T getCharacteristicInfo(CameraCharacteristics.Key<T> key) {
return characteristics.get(key);
}
Run Code Online (Sandbox Code Playgroud)
它是获取相机特性的函数。
如何正确检查变量是否是数组?
我使用 android studio 将 .svg 文件导入到矢量可绘制文件,然后 IDE 在文件夹:res/drawable 中创建了一个 xml 文件。
我认为android会像Canvas.drawPath一样绘制可绘制文件。而android:pathData的值几乎就是路径的点。但我不知道这个值的含义是什么。
我猜:
M : 移动到 L : 行到
Android向量中这些字符的含义是什么:
<path
android:fillColor="#FF000000"
android:pathData="M11,9h2L13,6h3L16,4h-3L13,1h-2v3L8,4v2h3v3zM7,
18c-1.1,0 -1.99,0.9 -1.99,2S5.9,22 7,22s2,-0.9 2,-2 -0.9,-2 -2,-2zM17,18c-1.1,
0 -1.99,0.9 -1.99,2s0.89,2 1.99,2 2,-0.9 2,-2 -0.9,-2 -2,
-2zM7.17,14.75l0.03,-0.12 0.9,-1.63h7.45c0.75,0 1.41,-0.41 1.75,-1.03l3.86,
-7.01L19.42,4h-0.01l-1.1,2 -2.76,5L8.53,11l-0.13,-0.27L6.16,6l-0.95,-2 -0.94,
-2L1,2v2h2l3.6,7.59 -1.35,2.45c-0.16,0.28 -0.25,0.61 -0.25,0.96 0,1.1 0.9,
2 2,2h12v-2L7.42,15c-0.13,0 -0.25,-0.11 -0.25,-0.25z"/>
Run Code Online (Sandbox Code Playgroud)