How to make a Scroll View Programmatically (Swift 2023, UIKit, Programmatic UI)

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025

ความคิดเห็น • 13

  • @azozsalah6709
    @azozsalah6709 ปีที่แล้ว

    Lately, I wasn't able to fully understand how UIScrollView is working, but this really helps me. Thanks man❤❤

  • @kaibu6848
    @kaibu6848 ปีที่แล้ว

    Really helpful to know how UIScrollView works. I appreciate it so much!!

  • @mohanr7574
    @mohanr7574 7 หลายเดือนก่อน

    Thank you, it helped me to learn how to scroll the view in scrollview programmatically

  • @horty894
    @horty894 ปีที่แล้ว +2

    Why are you adding imageViews onto self.view 12:02, but constraint it to contentView anchors? I guess we should add imageViews onto contentView

    • @diyshow888
      @diyshow888 11 หลายเดือนก่อน +1

      thats why scroll indicater is covered

  • @peterweyland117
    @peterweyland117 ปีที่แล้ว

    Thanks! Awesome tutorials)))

  • @djryanashton
    @djryanashton ปีที่แล้ว

    Thanks. Great video. :)
    I've been doing programmatic UIKit for a few months now and it's really strange to me why you have to set the width and height after already constraining all for sides.
    Interestingly, you set `hConst = UILayoutPriority(50)` which is identical to `UILayoutPriority.fittingSizeLevel`.
    Apple's documentation says this: " When you send a systemLayoutSizeFitting(_:) message to a view, the size fitting most closely to the target size is computed. This priority is quite low. It’s generally not appropriate to make a constraint at exactly this priority. You want to be higher or lower."
    So I suppose it would be better to set it higher or lower. In any case, `priority` is a new concept for me, so thanks for teaching me this. It's already coming in handy as I came here trying to solve a particular problem.

  • @bortanradu
    @bortanradu 11 หลายเดือนก่อน

    Do you know how I can have the same kind of layout but with scaleAspectFit? I want the images to not get cut and take the whole width of the screen. For that, the height of the image would have to be variable, so I can't set a height constraint, but without a height constraint the images aren't placed one right after the other anymore.

  • @abdurahmon2827
    @abdurahmon2827 4 หลายเดือนก่อน

    My brain gonna blow up, why they made uikit such hard

  • @rparham1997
    @rparham1997 ปีที่แล้ว

    Can you do videos on programmatic CollectionViews?

    • @Codebrah
      @Codebrah  ปีที่แล้ว

      Yup, I've got one coming soon

  • @mauanawest9062
    @mauanawest9062 ปีที่แล้ว

    video smart

  • @sysy2318
    @sysy2318 10 หลายเดือนก่อน

    thx