我做了一个可拖动的面板,但它隐藏在其他面板后面。
我更改了absolutePanel中的变量top,例如1 ,0或其他自然数,但它不起作用。我不确定如何使用变量top。
此外,可拖动的面板是清晰、透明的颜色,因此很难看到。
如何将可拖动面板显示为最顶部的面板。另外,如何用不透明的颜色给它上色。颜色。
下面是可拖动面板的示例代码。
下图显示了可拖动面板与一些面板一起隐藏,并且它的颜色是透明的。在该图中,代码shinythemes::themeSelector()生成了另一个可拖动面板,它既不是透明的,也不是隐藏的。所以,我想做这样的面板。

library(shiny)
# Define UI for application that draws a histogram
ui <- fluidPage(
shiny::tags$head(
shinythemes::themeSelector()
),#taghead
# Application title
titlePanel("Old Faithful Geyser Data"),
# Sidebar with a slider input for number of bins
# Show a plot of the generated distribution
mainPanel(
absolutePanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30),
draggable = T
),
plotOutput("distPlot")
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
}
# Run the application
shinyApp(ui = ui, server = server)使用@SeGa的css样式,我获得了以下内容:

发布于 2019-08-22 19:21:58
如果使用下面的css代码片段会怎么样:
css <- "
.ui-draggable {
z-index: 100000;
background-color: #cebfbf;
}"并将其包含在UI中:
shiny::tags$head(
shinythemes::themeSelector(),
tags$style(css)
)这解决了你的问题吗?
https://stackoverflow.com/questions/57607539
复制相似问题