-- 创建实现换行功能的文本 

function LoadLabelHeroIntroduce(objLabelContent)  //传入文本

---------------------------------     

 local tLabel = LG.Label:create() 

--  实现换行功能      tLabel:ignoreContentAdaptWithSize(false)    

   tLabel:setText(objLabelContent)    // 文本赋值

  local tSize = tLabel:getContentSize()    // 获取 size

  local tmp_width = tSize.width   

   local end_height = (tmp_width / 180 +1)* (tSize.height)   // 计算高度

   tLabel:setSize(Global_CCSize(180,end_height))     // 设置side

 return tLabel 

---------------------------------  end

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2022-02-19
  • 2021-07-28
  • 2022-01-09
  • 2021-07-19
猜你喜欢
  • 2021-11-01
  • 2022-03-08
  • 2022-01-22
  • 2021-12-23
  • 2022-01-01
相关资源
相似解决方案