[英]R Shiny 1.6 with {bslib} Package: Navbar Styling on Mobile - Bootstrap 4 vs. Bootstrap 3
[英]Navbar height when Including input through `bslib` helper functions in R Shiny
我正在尝试将常规 shiny 输入放在navbarPage
的右侧,但有一些问题。 当我不包含输入(在这种情况下为selectInput
)时,导航栏的高度更小且更紧凑,但是当我包含输入时,导航栏的高度增长到 ~85px 并且组件未对齐。 我已经为此苦苦挣扎了一段时间,而我的研究并没有为我带来任何胜利。 有人可以帮我指出正确的方向吗?
这是我为上面的屏幕截图整理的示例代码。
library(shiny)
library(shinyWidgets)
library(bslib)
ui <- navbarPage(
theme = bs_theme(version = 5, bootswatch = 'sandstone'),
tags$style(type = 'text/css', 'body {padding-top: 70px;}'),
title = 'Test',
id = 'Test',
fluid = TRUE,
useShinydashboard(),
tabPanel('Panel One',
sidebarLayout(
sidebarPanel(
HTML('There once was a man')
),
# Show a plot of the generated distribution
mainPanel(
HTML('from Nantucket')
)
)
),
nav_spacer(),
nav_item(
selectInput('view_options_auto_refresh_rate', '',
choices = list(
'No Auto Refresh' = Inf,
'1 Minute Refresh' = 60,
'10 Seconds Refresh' = 10,
'5 Seconds Refresh' = 5,
'1 Second Refresh' = 1
),
selected = Inf
)
)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)
我确实发现复选框或操作按钮没有相同的问题。 只是选择输入。
这是来自 RShiny 论坛 ( https://community.rstudio.com/t/navbar-height-when-including-input-through-bslib-helper-functions/144970 ) 的交叉帖子。 我有一段时间的问题,但没有答案。 我希望在这里发帖可以扩大受众范围。
谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.