我试图在Shinydashboard中更改selectinput下拉菜单的颜色,但我无法更改。这是我正在尝试做的一个简化示例
library(shiny)
ui <- fluidPage(
tags$style(
HTML(
'#FacilityID{ background-color: red;
}'
)
),
selectInput("FacilityID","Enter Facility ID",c("test1","test2")),
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
答案 0 :(得分:0)
通过一些试验和错误,我发现添加'selectize=FALSE'
可以完成这项工作。但是我不确定为什么要这样做。
library(shiny)
ui <- fluidPage(
tags$style("#FacilityID {background-color:blue;}"),
selectInput("FacilityID","Enter Facility ID",c("test1","test2"), selectize = FALSE)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)