Problems of VP and FP in Hongmeng OS

Time:2021-12-30

Hongmeng 2.0 has been published recently, and then studied the following code, but it is difficult to use units in XML layout,

Problems of VP and FP in Hongmeng OS

image.png

You can write 20 directly without writing units
You can also write 20px (PX everyone can understand, but you can’t use PX directly in development)
You can also write 20vp (what the hell is VP? Later, you can find VP in the development document, which is equivalent to DP in Android)
You can also write 20fp (what the hell is FP? Later, find FP in the development document, which is equivalent to sp in Android)

You can also go to the official documents and study it yourself. It’s the same as Androidhttps://developer.harmonyos.com/cn/docs/design/des-guides/basic-0000001055539104

Recommended Today

Redis featured Q & A

Redis data type type brief introduction characteristic scene String (string) Binary security It can contain any data, such as JPG pictures or serialized objects. One key can store up to 512M It can be used to do the simplest data. It can cache a simple string or a JSON format string. The implementation of redis […]