tips最小限制

This commit is contained in:
chenxi 2023-04-20 21:08:03 +08:00
parent 9c70bfbfed
commit 325b34a691

View File

@ -36,7 +36,11 @@ function DescTips:onRefresh()
-- 这里原来是用preferredHeight,但是在中英文混合的时候这个值可能不准,只有改用renderedHeight -- 这里原来是用preferredHeight,但是在中英文混合的时候这个值可能不准,只有改用renderedHeight
-- renderedHeight必须要先调用下ForceMeshUpdate强制刷新才有效 -- renderedHeight必须要先调用下ForceMeshUpdate强制刷新才有效
self.descTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO):ForceMeshUpdate() self.descTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO):ForceMeshUpdate()
self.bg:setSizeDeltaY(self.descTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).renderedHeight + 18) local height = self.descTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).renderedHeight + 18
if height < 130 then
height = 130
end
self.bg:setSizeDeltaY(height)
if self.tarCornerScreenPos then if self.tarCornerScreenPos then
self:locate(self.location, self.originSizeDelta, self.bg, self.tarCornerScreenPos) self:locate(self.location, self.originSizeDelta, self.bg, self.tarCornerScreenPos)
end end