Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>SDCycleScrollView.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@
/** 只展示文字轮播 */
@property (nonatomic, assign) BOOL onlyDisplayText;

/** 标题是否在顶部显示 */
@property (nonatomic, assign) BOOL showOnTop;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ - (void)layoutSubviews
CGFloat titleLabelW = self.sd_width;
CGFloat titleLabelH = _titleLabelHeight;
CGFloat titleLabelX = 0;
CGFloat titleLabelY = self.sd_height - titleLabelH;
CGFloat titleLabelY = self.showOnTop ? 0 : self.sd_height - titleLabelH;
_titleLabel.frame = CGRectMake(titleLabelX, titleLabelY, titleLabelW, titleLabelH);
}
}
Expand Down
3 changes: 3 additions & 0 deletions SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ typedef enum {
/** 滚动手势禁用(文字轮播较实用) */
- (void)disableScrollGesture;

/** 标题是否在顶部显示 */
@property (nonatomic, assign) BOOL showOnTop;


////////////////////// 清除缓存API //////////////////////

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSe
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
SDCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];

cell.showOnTop = self.showOnTop;
long itemIndex = [self pageControlIndexWithCurrentCellIndex:indexPath.item];

if ([self.delegate respondsToSelector:@selector(setupCustomCell:forIndex:cycleScrollView:)] &&
Expand Down