ScrollView を一番下から開始したいと思います。方法はありますか?
私はすでにこれを試しましたが、トップに戻ることはできません....
CGPoint bottomOffset = CGPointMake(0, [yourScrollView contentSize].height);
[yourScrollView setContentOffset:bottomOffset animated:YES];
ScrollView を一番下から開始したいと思います。方法はありますか?
私はすでにこれを試しましたが、トップに戻ることはできません....
CGPoint bottomOffset = CGPointMake(0, [yourScrollView contentSize].height);
[yourScrollView setContentOffset:bottomOffset animated:YES];
を使用する必要があると思います
[self.catScroll scrollRectToVisible:CGRectMake(fr.frame.origin.x,0 , self.catScroll.frame.size.width, self.catScroll.frame.size.height) animated:NO];
catScroll
scrollViewはどこですか
またはのデリゲート メソッドsetContentOffset:
でこのプロパティを新しい contentoffset に変更するscrollView
scrollViewDidEndDecelerating:
これは間違いなくあなたを助けると思います。
ハッピーコーディング:)
あなたは電話するべきです
CGPoint bottomOffset = CGPointMake(0, [yourScrollView contentSize].height);
[yourScrollView setContentOffset:bottomOffset animated:NO];
ビューでDidLoad。そして、変更を試みる前にyourScrollView
、IBOutlet に正しく接続されているか、またはから受信さ[self.view viewWithTag:];
れ、内容のサイズにcontentSize
設定されている必要があることを確認してください。UIScrollView
contentOffset
ところで、最初から一番下にするには、animated:NO を設定する必要があります