我正在尝试更改一个闪亮应用程序中按钮的背景颜色,但由于某些原因,我无法更改颜色。当我查看html时,我甚至找不到按钮的id,我只看到按钮内的文本的id。
我想这要归功于shinythemes,但我不确定。如何更改此示例应用程序中的按钮颜色?有没有人可以验证他们有同样的问题,如果他们运行这个应用程序,或者可能只是我的设置。
library(shiny)
library(shinythemes)
ui = fluidPage(
theme = shinytheme("cerulean"),
navbarPage("App Name", selected = "Tab1",
id = "navbar",
position = "fixed-top",
tabPanel("Tab1", id = "tab1Id",
#padding between navbar and page when using fixed-top
tags$style(type="text/css", "body {padding-top: 70px;}"),
fluidPage(
actionButton("saveBtn2", "Update Schedule",
icon("floppy-o"),
#style="color: #0000ff;border-color: #2e6da4; background-color: #0000ff"
style = "background-color: #e7e7e7; color: black"
)
)
)
)
)
server = function(input, output, session) {}
runApp(shinyApp(ui, server))发布于 2020-12-03 04:37:06
也许你想试试actionBttn。
ui = fluidPage(
theme = shinytheme("cerulean"),
navbarPage("App Name", selected = "Tab1",
id = "navbar",
position = "fixed-top",
tabPanel("Tab1", id = "tab1Id",
#padding between navbar and page when using fixed-top
tags$style(type="text/css", "body {padding-top: 70px;}"),
fluidPage(
actionBttn('insertBtn1',
'Add variable',
style = "simple",
color = "primary",
icon=icon("floppy-o"),
size = "sm",
block = FALSE,
no_outline = TRUE
),
actionButton("saveBtn2", "Update Schedule",
icon("floppy-o"),
#style="color: #0000ff;border-color: #2e6da4; background-color: #0000ff"
style = "background-color: #e7e7e7; color: black"
)
)
)
)
)
server = function(input, output, session) {}
runApp(shinyApp(ui, server))

https://stackoverflow.com/questions/65112357
复制相似问题