调整仪表板中整个页眉栏的高度闪亮仪表板中的页眉 [英] Adjust height of the whole header bar in dashboardHeader in shiny dashboard
本文介绍了调整仪表板中整个页眉栏的高度闪亮仪表板中的页眉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我看到这里有一个类似的问题:
Adjust height of dashboardheader in shinydashboard
但我没有资格对给定的答案发表评论。
此答案的解决方案将适用于我想要扩展标头大小的情况。然而,当我将大小减少到20像素时,这只会更改标题部分的高度,我希望减少闪亮仪表板中整个标题栏的高度。 这可能吗?
以下是使用上述问题的解决方案的示例:
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(
# Set height of dashboardHeader
tags$li(class = "dropdown",
tags$style(".main-header {max-height: 20px}"),
tags$style(".main-header .logo {height: 20px}")
)
),
dashboardSidebar(
# Adjust the sidebar
tags$style(".left-side, .main-sidebar {padding-top: 20px}")
),
dashboardBody()
)
server <- function(input, output){}
shinyApp(ui, server)
推荐答案
您需要覆盖导航栏的最小高度和侧边栏切换上的填充。我已更新您的示例如下:
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(
# Set height of dashboardHeader
tags$li(class = "dropdown",
tags$style(".main-header {max-height: 20px}"),
tags$style(".main-header .logo {height: 20px;}"),
tags$style(".sidebar-toggle {height: 20px; padding-top: 1px !important;}"),
tags$style(".navbar {min-height:20px !important}")
)
),
dashboardSidebar(
# Adjust the sidebar
tags$style(".left-side, .main-sidebar {padding-top: 20px}")
),
dashboardBody()
)
server <- function(input, output){}
shinyApp(ui, server)
这篇关于调整仪表板中整个页眉栏的高度闪亮仪表板中的页眉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文