我在shiny中创建了一个sidebarLayout,它允许在mainPanel溢出时滚动。sidebarPanel的位置保持固定,因此当您向下滚动mainPanel时,它会消失。但是,我希望它能够随着mainPanel一起滚动,这样用户就不需要再向上滚动来更改设置了。我该如何做到这一点?
基本设置:
基本设置:
ui = fluidPage(
tags$style(type='text/css', 'body { overflow-y: scroll; }'),
titlePanel(
# ...
),
sidebarLayout(
sidebarPanel(
# ...
width = 3),
mainPanel(
# ...
width = 9 )
))
server = function(input,output,session) {
# ...
}
shinyApp(ui=ui, server=server)
style = "position:fixed;width:22%;"
用于调整填充为22%,如解决方案中所述。 - user989762