Hello.
I need to create a custom Popup with Label in it. I've created a layout for Popup in Native Ui Builder, using RelativeLayout for both portrait and landscape orientations. Width of the Popup is different for different orientation.
Text in Label may be long, so I set the height of Label as "fit to content". As height of Label can become bigger, I supposed to change the height of the whole Popup:
void SetText(const Tizen::Base::String& text) { m_myLabel->SetText(); std::unique_ptr<RelativeLayout> layout(static_cast<RelativeLayout*>(GetLayoutN())); layout->Update(); int newPopupHeight = m_myLabel->GetHeight() /* + other controls height */; if (GetHeight() < newPopupHeight) { SetSize(GetWidth(), newPoupHeight); } }
This works fine, but only for one orientation. After calling SetSize() the width of Popup will be the same for all orientations.
Is there any simple to make this work for both orientations?
Thanks for any tips.