我正在尝试设置什么应该是一个简单的水平布局使用UICollectionView,绕圈而没有达到预期的结果所以任何指针或例子将不胜感激.
可能很少有点我粘贴代码经常改变而没有成功.
图像显示两行,第一行是单个项目,大小正确,并在中心正确对齐.第二行有3个项目,第一行应该与上面的项目大小相同,下一个项目边缘只是可见,表示另一个项目.当项目向左滑动时,它们应该是3个可见的项目 - 主要项目在中心完全可见,项目1和3在左右边缘可见.
我曾尝试设置分页上,不断变化的insetForSectionAtIndex,minimumLineSpacingForSectionAtIndex,minimumInteritemSpacingForSectionAtIndex.
我没有解释或说明这一点,所以下面有更好的说明.I know how to create the collection view, set the item size etc but can not get the desired layout.
这是单行水平UICollectionView,其中一个项目始终在全视图中,并且其部分视图中的相邻项目向用户指示根据滚动位置和项目计数向左或向右的项目.
objective-c horizontalscrollview ios uicollectionview uicollectionviewlayout
我一直在看各种木偶问题而没有找到我追求的东西,并希望有人可以给我一些合理的建议和几个指针.我是新手,只是希望在我在github上选择的样板启动包上构建
https://github.com/coombsj/RequireJS-BackboneJs-MarionetteJS-Bootstrap_Starter
我想建立两件事;
它有一个导航结构和我得到的几个区域,但除了LandingView.html之外,导航不会加载contentRegion中的任何页面.
这似乎是现在模板页面创建(手柄),我很好,但他们正在努力正确创建路由和控制器部分.
目前,Router.js看起来像这样
define(['marionette', 'app/Controller'],
function (marionette, Controller) {
'use strict';
return marionette.AppRouter.extend({
appRoutes: {
'test' : 'testView',
'*action' : 'logAction'
},
controller: Controller
});
});
Run Code Online (Sandbox Code Playgroud)
和Controller.js
define(['app/views/LandingView'],
function (LandingView) {
"use strict";
return {
logAction: function (action) {
console.log(action);
S2C.content.show(new LandingView());
}
};
});
define(['app/views/testView'],
function (testView) {
"use strict";
return {
testView: function (test) {
console.log(action);
S2C.content.show(new testView());
}
};
});
Run Code Online (Sandbox Code Playgroud)
LandingPage加载正常
LandingView.js
define(['marionette', 'tpl!app/views/_templates/LandingView.html'],
function (Marionette, template) …Run Code Online (Sandbox Code Playgroud)