将图像嵌入闪亮仪表板

问题描述 投票:0回答:1

问题:我想在标题的右上角添加第二张图片。目前,我可以将一个放置在左上角,但不能放置在右上角。

任何建议如何做?

## app.R ##
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
                  header = dashboardHeader( titleWidth = NULL,
                                            title = tags$b("Testapp",
                                                           tags$a(href = 'https://www.google.com/', 
                                                                  tags$img(src = 'mick.png', height = 50, width = 50, align = "left"))
                                            ),

                                              ## QUESTION: how can I add the picture to the top right corner
                                             tags$head(tags$img(src = 'mick.png', height = 50, width = 50, align = "right"))



  ),
  dashboardSidebar(),
  dashboardBody()
)

server <- function(input, output) { }

shinyApp(ui, server)
r shiny shinydashboard
1个回答
0
投票

Shinydashboard期望使用li类的dropdown元素。如果我们给它(用下面的内容替换tags$head(...)):

tags$li(tags$img(src = 'mick.png', height = 50, width = 50, align = "right"), class = "dropdown")

有效。

© www.soinside.com 2019 - 2024. All rights reserved.