简体   繁体   English

不同尺寸的TableView节索引标题大小

[英]TableView section index title size for different dimension

在此处输入图片说明 I have used sectionForSectionIndexTitle delegate method to create an index for each section on the right side of the tableview , everything is working fine but the problem I am facing is when I run this app on iPhone 5s , the screen size is small as compared to other screen sizes and alphabetic index on the right is not showing within the screen heigh and few alphabets are out of the screen area and not visible to the user. 我已经使用sectionForSectionIndexTitle委托方法为tableview右侧的每个部分创建了一个索引,一切正常,但是我面临的问题是在iPhone 5s上运行此应用程序时,屏幕尺寸比其他屏幕小屏幕高度和右侧的字母索引未显示在屏幕高度内,并且少数字母不在屏幕区域之外,用户也不可见。 Can some one please guide how I can control the index heigh on the right side of the table view so it fits in small screen dimensions as well. 请问有人可以指导我如何控制表格视图右侧的索引高度,以便它也适合较小的屏幕尺寸。

//Mark - sectionForSectionIndexTitle
    func tableView(_ tableView: UITableView, sectionForSectionIndexTitle title: String, at index: Int) -> Int {
        return groupIndexTitles.firstIndex(of: title)!
    }

OS will automatically truncate your array if it's too long. 如果太长,操作系统会自动截断阵列。 For example, if you view your contact list in portrait orientation you will see a full index AZ but when you rotate to landscape you'll see A * D * .... and so on. 例如,如果以纵向查看联系人列表,则将看到完整的索引AZ,但旋转到横向时将看到A * D * ....依此类推。 You can't size. 你不能大小。 But you can create custom tableview and integrate custom index view. 但是您可以创建自定义表格视图并集成自定义索引视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM