talkingjourney / scindexview Goto Github PK
View Code? Open in Web Editor NEWSCIndexView provide a index view like Wechat.
License: MIT License
SCIndexView provide a index view like Wechat.
License: MIT License
索引比较少的时候,最后几个无法选中,这个有解决方法吗?因为有选中态,每次点一下下面的字母,都跳回到之前的选中?这个能加个方法吗?要不然看着很奇怪。。
因为 UITableView+SCIndexView.h 中声明了 sc_indexViewDelegate 是 weak 的,sc_indexViewDataSource 是 copy 的,在 .m 中第141行应该用 OBJC_ASSOCIATION_ASSIGN, 166行用 OBJC_ASSOCIATION_COPY_NONATOMIC
如题
出一个swift版本的
目前样式只有2种仅供选择,不能自定义
最后几个怎么选中不了 ,会固定到H的位置
当所有数据不足当前页面展示时,无法选中最后面几个索引,可否支持也能选中状态,类似微信如果数据到最底部时,最后几个索引也可以点击选中状态。(数据足够多的时候,但最后几个分区数据不足一屏时,划到最低部时,最后几个索引也是无法选中状态)
(void)setSc_indexViewDelegate:(id)sc_indexViewDelegate
{
if (self.sc_indexViewDelegate == sc_indexViewDelegate) return;
objc_setAssociatedObject(self, @selector(sc_indexViewDelegate), sc_indexViewDelegate, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
当tableviewStyle为group类型的时候,第一个索引随滑动会闪烁,plain没问题
如题
UIKitCore | -[UITableView _updateFocusAfterLoadingCellsWithFocusedView:viewType:] + 200 |
---|---|
11 UIKitCore | -[UITableView _endUpdatingVisibleCells:originalContentOffset:focusedView:focusedViewType:] + 172 |
12 UIKitCore | -[UITableView _updateVisibleCellsNow:] + 3460 |
13 UIKitCore | -[UITableView layoutSubviews] + 356 |
14 DUApp | -[UITableView(SCIndexView) SCIndexView_layoutSubviews] (UITableView+SCIndexView.m:50) |
15 UIKitCore | -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2500 |
-[SectionItem isEqualToString:]: unrecognized selector sent to instance 0x280eba040
warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.
底层是scrollView,上面4个subview为tableView时(横向滑动切换界面模式),如果第一个tableView使用SCIndexView,第二个tableView部分界面会被第一个tableView的SCIndexView遮挡,导致第二个tableView的部分cell无法点击.IndexView的frame应该超过了tableView的frame.
我临时的解决办法是把使用SCIndexView了的tableView再加一层底view,这样SCIndexView超出的部分不会影响其他tableView.
iOS14.2 滑到或者点击到倒数第三个索引就滑不下去了
需求是这样的我的第一个索引应为一个🔍,但是UITableViewIndexSearch会转成“{search}”串,而不能类似系统自带的转换为一个放大镜图标。求解决 目前这个索引必须要使用搜索功能。
如果有tableHeaderView的话,如果再最上面添加一个图片
类似微信最上面是个搜索框,索引第一个是一个🔍的图片
第一个数据源的话会导致数据里有+1这种代码来重新计算数据源并不是一个好的方式。。。
真机调试 6sPlus 系统 10.3.2
崩溃信息
'NSInternalInconsistencyException', reason: 'An instance 0x10107dc00 of class UITableView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x174223160>
希望能够支持collectionView
iOS14.2 滑到或者点击到倒数第三个索引就滑不下去了
点击状态栏会自动滚动到最上面,然而索引没有移动
可能和实现有关,好想没有监听刀移动。。。
用masonry 初始化的时候frame为0的,所以先显示的 这个方法里面要加一个判断
加上这两行代码 就OK了
if (self.configuration.indexViewStyle == SCIndexViewStyleCenterToast){
_indicator.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2);
}
(void)showIndicator:(BOOL)animated
{
if (!self.indicator.hidden || self.currentSection < 0 || self.currentSection >= (NSInteger)self.subTextLayers.count) return;
CATextLayer *textLayer = self.subTextLayers[self.currentSection];
if (self.configuration.indexViewStyle == SCIndexViewStyleDefault) {
self.indicator.center = CGPointMake(self.bounds.size.width - self.indicator.bounds.size.width / 2 - self.configuration.indicatorRightMargin, textLayer.position.y);
}else if (self.configuration.indexViewStyle == SCIndexViewStyleCenterToast){
_indicator.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2);
}
self.indicator.text = textLayer.string;
if (animated) {
self.indicator.alpha = 0;
self.indicator.hidden = NO;
[UIView animateWithDuration:kAnimationDuration animations:^{
self.indicator.alpha = 1;
}];
} else {
self.indicator.alpha = 1;
self.indicator.hidden = NO;
}
}
当通过presentviewcontroller到tableview页面后(系统大于ios 13),右侧的索引视图滑动时会失效,只能通过点击进行与tableview的互动,而无法通过正常滑动进行.
尝试将scindexview的demo中push改为present后该问题也在示例demo中出现.是否有较好的解决办法?感谢回复!
这样的话,不重写,原来默认的索引计算就满足不了了。老是超前一个。在A的时候就显示B,D的时候显示E
希望给点建议
因为业务的关系,需要在tableview上动态遮盖一层view,数据会自动通过网络获取,导致本来隐藏在下面遮盖下的索引显示到了上面
解决方法
configCurrentSection
172行
if (sectionFrame.origin.y + sectionFrame.size.height - self.tableView.contentOffset.y > insetTop+1) {
每个索引之间的间隔。
项目需求,IndexView从tableView顶部往下排列,非居中.
你好 ,我的怎么自动往上偏移 一位啊, 选择了 B ,他自动到 A 上面去了
pod install失败,也search不到
联系人最后索引位 y z #
通过索引移动到 # 后,因为#下数据较少,移动一下列表索引会选中到Y,微信的处理是触摸事件结束会更正一次索引位置
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.