search

Home  >  Q&A  >  body text

hybrid-app - weex ios Android How to disable right swiping in the information filling interface

Use weex to develop a hybrid app. When filling in the information page, the user may accidentally click the return key in the lower left corner (android) or swipe right (iOS), and the interface will exit

Question: The interface will exit, but we need the user to confirm the exit before allowing the interface to exit. How to achieve this???

迷茫迷茫2774 days ago1398

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-07-04 13:47:11

    You need to intercept the return event
    Android has it

    <template>
      <p @androidback="back">
      </p>
    </template>
    
    <script>
      export default {
        methods: {
          back () {
            //dosomething
          }
        }
      }
    </script>

    I don’t know about iOS, but using the right swipe operation should not be an accidental operation... But if you want to implement it, you can use the native fireEvent and then monitor it on the front-end page

    You can refer to /a/11...

    reply
    0
  • Cancelreply