Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 是否从UITableViewCell获取UITableView分隔色?_Ios_Uitableview_Uikit - Fatal编程技术网

Ios 是否从UITableViewCell获取UITableView分隔色?

Ios 是否从UITableViewCell获取UITableView分隔色?,ios,uitableview,uikit,Ios,Uitableview,Uikit,是否有一种简单的方法可以从-[UITableViewCell initWithStyle:reuseIdentifier:][code>中获取UITableView的分隔颜色 我问这个问题是因为我使用的是-[UITableView-dequeueReusableCellWithIdentifier:forindexath:,我想在UITableViewCell中添加一个与tableView的separatorColor颜色相同的垂直分隔符 尽管如此,还是有-[UITableViewCell分隔符

是否有一种简单的方法可以从
-[UITableViewCell initWithStyle:reuseIdentifier:][code>中获取
UITableView的
分隔颜色


我问这个问题是因为我使用的是
-[UITableView-dequeueReusableCellWithIdentifier:forindexath:
,我想在
UITableViewCell
中添加一个与
tableView
separatorColor
颜色相同的垂直分隔符

尽管如此,还是有
-[UITableViewCell分隔符集]


我建议您使用硬编码
tableView.separatorColor
和您想要的任何
UIColor
并在
-[UITableViewCell initWithStyle:reuseIdentifier::
中使用相同的
UIColor

尽管如此,还是有
-[UITableViewCell分隔符集]


我建议使用硬编码
tableView.separatorColor
和您想要的任何
UIColor
并在
-[UITableViewCell initWithStyle:reuseIdentifier::

中使用相同的
UIColor
,由于分隔符视图由UITableView管理,UIKit不会将颜色暴露给UITableViewCell。但是,分隔符插入可由单元配置,因为只有单元才应该知道其布局,这可能会更改所需的插入


我建议在配置单元格时,在
-[UITableView tableView:willDisplayCell:forRowAtIndexPath:
-[UITableView tableView:cellForRowAtIndexPath:

中输入颜色,因为分隔符视图由UITableView管理,UIKit不会向UITableView单元格显示颜色。但是,分隔符插入可由单元配置,因为只有单元才应该知道其布局,这可能会更改所需的插入

我建议在配置单元格时,在
-[UITableView tableView:willDisplayCell:forRowAtIndexPath:][/code>或
-[UITableView tableView:cellForRowAtIndexPath:][/code>