Label与ScrollView
来源:互联网 发布:站群软件 编辑:程序博客网 时间:2024/05/18 01:33
-- 初始化界面并绑定有用节点function EscortRuleDialog:__initViewAndBindNode() local layout = UI.nodeFromCSB( Res.FileNames.res_ui_caravan_new_caravan_explain_csb, self ) layout:setPosition( VisibleRect:center() ) self:addChild( layout ) -- 获取help表 local helpDict = Dict.HelpList[self.initType] -- 设置标题 UI.setString( self.lbl_title, helpDict.title ) -- 配置数据 local nodeSize = cc.size( 520, 29 ) local rowList = {} local totalHeight = 0 -- 初始化配置数据 local strList = LuaUtils.Split2( helpDict.content, "#" ) -- 初始化滚动视图 UI.fixScrollView( self.scr_bg ) self.scr_bg:setContentSize( cc.size( nodeSize.width, nodeSize.height * 9 ) ) -- 初始化界面 local addUpHeight = 0 local offset = 30 local size = #strList for i=size, 1, -1 do local label = cc.Label:createWithTTF( T(strList[i]), Res.FileNames.res_font_arts_ttf, 20 ) label:setTextColor( cc.c3b( 12, 219, 244 ) ) label:setMaxLineWidth( nodeSize.width - offset ) label:setAnchorPoint( 0 , 0 ) label:setPosition( cc.p( offset , addUpHeight ) ) self.scr_bg:addChild( label ) addUpHeight = addUpHeight + label:getContentSize().height local symbol = cc.Label:createWithTTF( "◆", Res.FileNames.res_font_arts_ttf, 20 ) symbol:setTextColor( cc.c3b( 12, 219, 244 ) ) symbol:setAnchorPoint( 0 , 0 ) label:addChild( symbol ) symbol:setPosition( cc.p( -offset , label:getContentSize().height - symbol:getContentSize().height ) ) end local totalHeight = addUpHeight if totalHeight <= nodeSize.height * 9 then local labels = self.scr_bg:getChildren() for i, label in ipairs( labels ) do label:setPositionY( label:getPositionY() + (nodeSize.height * 9 - totalHeight) ) end totalHeight = nodeSize.height * 9 end self.scr_bg:setInnerContainerSize( cc.size( nodeSize.width, totalHeight ) ) UI.onClick( self.btn_close, EscortRuleDialog.closeCallback, self ) UI.changeBtnSize( self.btn_close, 2, 2 )end
0 0
- Label与ScrollView
- 使用SnapKit约束label、scrollview和tableview
- Label 的富文本 与 自定义Label
- Annotation与Label
- 用3个label实现scrollView的循环滚动效果
- ScrollView 与 Gallery 冲突
- ScrollView与Keyboard协同
- listView 与scrollView 共存
- scrollview与listview冲突
- ScrollView 与 Autolayout
- ScrollView 与 Autolayout
- ScrollView 与 Autolayout
- scrollView 与 Autolayout
- ScrollView 与 Autolayout
- ScrollView 与 Autolayout
- ScrollView 与 Autolayout
- EditText与scrollView
- ScrollView 与 Autolayout
- 单击生成div,定时器自动隐藏
- Mac下利用Hexo+GitHub轻松搭建自己的博客
- 使用数据库排序or使用具体编程语言排序
- 链表划分(引申到快速排序)
- Hexo博客搭建与优化过程中常见问题及解方案
- Label与ScrollView
- 51nod 1024 矩阵中不重复的元素(数学水题-取对数)
- 【HAOI2008】硬币购物
- 有些段子
- HDU 5916 Harmonic Value Description【构造】【2016中国大学生程序设计竞赛(长春)】
- 字符串翻转算法-JAVA
- typedef常用方法
- EL表达式
- Linux程序设计--线程