質問編集履歴
4
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
特定セルを指定位置にスクロールさせるメソッド`scrollToRow(at:at:animated:)`のように
|
2
2
|
特定のセクションヘッダーを指定してスクロールするメソッド、もしくは簡単な方法はありますか?ご存知でしたら教えて下さい。
|
3
3
|
|
4
|
+
|
4
5
|
```swift
|
5
|
-
let targetSectionRect = self.
|
6
|
+
let targetSectionRect = self.testTableView.rectForHeader(inSection: indexPath.section)
|
6
7
|
let yPosition = targetSectionRect.minY
|
7
8
|
|
8
9
|
testTableView.setContentOffset(CGPoint(x: 0.0, y: yPosition), animated: true)
|
9
10
|
```
|
10
11
|
|
11
|
-
↑という感じでやってみたのですが、セクションがvisibleでない場合にrectが取れず実現できません。
|
12
|
+
↑という感じでやってみたのですが、~~セクションがvisibleでない場合にrectが取れず実現できません~~。
|
13
|
+
indexPathの生成が間違っていたため動きませんでしたが、動くようになりました。
|
12
14
|
|
13
15
|
sectionHeaderは画面内に残らないように↓のように設定してあります。
|
14
16
|
[UITableViewでSectionHeader/SectionFooterを残さない方法](https://qiita.com/Yuta/items/a804a25d82ade964b315)
|
3
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
特定セルを指定位置にスクロールさせるメソッド`scrollToRow(at:at:animated:)`のように
|
2
|
-
セクションヘッダーを指定
|
2
|
+
特定のセクションヘッダーを指定してスクロールするメソッド、もしくは簡単な方法はありますか?ご存知でしたら教えて下さい。
|
3
3
|
|
4
4
|
```swift
|
5
5
|
let targetSectionRect = self.leftTableView.rectForHeader(inSection: indexPath.section)
|
2
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,4 +8,7 @@
|
|
8
8
|
testTableView.setContentOffset(CGPoint(x: 0.0, y: yPosition), animated: true)
|
9
9
|
```
|
10
10
|
|
11
|
-
↑という感じでやってみたのですが、セクションがvisibleでない場合にrectが取れず実現できません。
|
11
|
+
↑という感じでやってみたのですが、セクションがvisibleでない場合にrectが取れず実現できません。
|
12
|
+
|
13
|
+
sectionHeaderは画面内に残らないように↓のように設定してあります。
|
14
|
+
[UITableViewでSectionHeader/SectionFooterを残さない方法](https://qiita.com/Yuta/items/a804a25d82ade964b315)
|
1
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,2 +1,11 @@
|
|
1
1
|
特定セルを指定位置にスクロールさせるメソッド`scrollToRow(at:at:animated:)`のように
|
2
|
-
セクションヘッダーを指定指定してスクロールするメソッド、もしくは簡単な方法はありますか?ご存知でしたら教えて下さい。
|
2
|
+
セクションヘッダーを指定指定してスクロールするメソッド、もしくは簡単な方法はありますか?ご存知でしたら教えて下さい。
|
3
|
+
|
4
|
+
```swift
|
5
|
+
let targetSectionRect = self.leftTableView.rectForHeader(inSection: indexPath.section)
|
6
|
+
let yPosition = targetSectionRect.minY
|
7
|
+
|
8
|
+
testTableView.setContentOffset(CGPoint(x: 0.0, y: yPosition), animated: true)
|
9
|
+
```
|
10
|
+
|
11
|
+
↑という感じでやってみたのですが、セクションがvisibleでない場合にrectが取れず実現できません。
|