webpage repeatedly page when start web is horizontal(Landscape) layout

  1. ‹ Older
  2. 12 months ago

    Michel B

    3 Jun 2019 Testers, Xojo Pro
    Edited 12 months ago

    OK. Here is the workaround I used . I post it here to help the poor souls who stumble on the same issue in the future.

    I had already added the PreviousAngle as Integer to the session, which is set in the OrientationChanged Event.

    I added a multiple 1000 ms WebTimer to each page (WebPageAndroidPortrait and WebPageAndroidLandscape) with this in the Action event (on WebPageAndroidPortrait) :

    Sub Action() Handles Action
      Dim ref As WeakRef
      ref = New WeakRef(session)
      If ref.Value <> Nil Then
        if Session(ref.Value).PreviousAngle = 90 or Session(ref.Value).PreviousAngle = 90 then
        End If
      end if
    End Sub

    Of course, the code needs to be modified to PreviousAngle 0 and 180, as well as show WebPageAndroidPortrait for the WebTimer on WebPageAndroidLandscape

    I don't know if this could be implemented, but it would make more sense to have OrientationChanged on webPages, instead of session. Or if "by design", the OrientationChanged event fired only once, and did not create undue new sessions.

or Sign Up to reply!