omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. zmous

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    zmous

    @zmous

    0
    Reputation
    537
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    zmous Unfollow Follow

    Latest posts made by zmous

    • RE: Making a Transparent Webview

      @cvp unfortunately crashes, however the code provided by @zrzka does work just fine. Anyway thanks alot!

      posted in Pythonista
      zmous
      zmous
    • Making a Transparent Webview

      so kinda wanted to create animated charts in pythonista except that matplotlib creates static ones and non interactive charts. I was thinking if there's a way to sorta wrap Chartjs (a JavaScript library for cretaing charts) in a webview and set it's background to be clear. i tried doing this but i ran into a problem:
      • setting a clear background webview doesn't seem all that easy, although it seems that it could be done using obj_util (something i am unfamiliar with)

      Any help would be very much appreciated thanks alot

      Update: All right so i have been looking around and found this: https://stackoverflow.com/questions/3646930/how-to-make-a-transparent-uiwebview

      Which i tried implementing as follows ( But for some reason pythonista crashes instead):

      #[webView setBackgroundColor:[UIColor clearColor]];
      
      from objc_util import *
      import ui
      
      UIColor=ObjCClass('UIColor')
      
      class WebViewContainer (ui.View):
          def __init__(self, web_view):
              ui.View.__init__(self)
              self.web_view = web_view
              self.add_subview(web_view)
              _web_view = ObjCInstance(web_view)
              _web_view.setBackgroundColor_(UIColor.clearColor().CGColor())
              _web_view.setOpaque_('NO')
      
      w,h=ui.get_screen_size()
      wv=ui.WebView()
      wv.frame=(0,0,w,h)
      wvo=WebViewContainer(wv)
      view=ui.View()
      view.add_subview(wvo)
      view.present()
      
      posted in Pythonista
      zmous
      zmous