applibgroup / HarmonyOS-Knowledgebase

This repository contains code samples of HarmonyOS Training
Apache License 2.0
17 stars 6 forks source link

What is the alternative function in HarmonyOS for onMeasure in Android OS? #4

Closed Sanku-Yogesh closed 3 years ago

Sanku-Yogesh commented 3 years ago

Describe the query

I am writing a custom component in HarmonyOS using Java SDK. In order to negotiate the width and height of the custom view in Android, we override onMeasure().

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {}

What is the alternative for the above in HarmonyOS?

Create the query with harmonyos tag in stackoverflow and share the link here:

https://stackoverflow.com/questions/68524730/what-is-the-alternative-function-in-harmonyos-for-onmeasure-in-android-os

Additional information

Developer Platform: Windows DevEco Studio version: 2.1.0.303 SDK API version: 5 SDK version: 2.1.1.21 Device: Not Required Device OS version: Not Required

Regards, Yogesh.

kanaksony commented 3 years ago

Hi @Sanku-Yogesh,

I have already replied to the above query on Stackoverflow and you have accepted the answer, I would close this issue now.

Thanks, Kanak