Logo instead of application title Shiny

久未见 提交于 2020-07-19 11:58:22

问题


How can I put instead of title in Shiny app:

navbarPage("title",theme = shinytheme("flatly"), 
                   tabPanel("Home",

some logo in the size of menu tab? I tried this solution: How can I insert an image into the navbar on a shiny navbarPage() but someway is not working. Image too big overlay all menu items

Thx


回答1:


This is an old question but I was looking for a solution and the other ones I found caused issues when I tried to publish my application using shinyapps.io and this was due to the fact that I was using both fluidPage and navbarPage as suggested in orther answers.

Here is my solution which I recieved from the support team at shinyapps.io

#~~~~~~~~~~~~~~~~~~~~~~~ LOGAN SERVICES DASHBOARD ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                   ui <- shiny::navbarPage(

                     #the line of code places the logo on the left hand side before the tabs start. See image below.
                       title = div(img(src='LoganTogether-LOGO.jpg',style="margin-top: -14px; padding-right:10px;padding-bottom:10px", height = 60)),
                       #theme = "journal",
                       windowTitle="Logan Together: Service Map",


          #MAIN TAB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                       

                   tabPanel("Interactive map", # then you go on to code the rest of your UI as normal



来源:https://stackoverflow.com/questions/33219885/logo-instead-of-application-title-shiny

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!