徽标而不是应用程序标题闪亮

时间:2015-10-19 16:55:26

标签: r user-interface shiny navbar tabpanel

如何在Shiny app中添加标题而不是标题:

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

菜单标签大小的某些徽标? 我试过这个解决方案: How can I insert an image into the navbar on a shiny navbarPage() 但有些不起作用。图像太大覆盖所有菜单项

THX

1 个答案:

答案 0 :(得分:1)

这是一个古老的问题,但是我正在寻找解决方案,当我尝试使用Shinyapps.io发布应用程序时,我发现了其他问题,这是由于我同时使用fluidPage和navbarPage作为事实在其他答案中建议。

这是我从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

enter image description here