r - 如何为 R shinyWidgets > prettyToggle > label_on(和 label_off)换行文本
问题描述
函数“label_on”(shinyWidgets > prettyToggle)的文本太长,超出了框框。如何包装文本并留在框内?
我在这里发现了类似的问题,但对于 pickerInput (如何从 pickerInput 中对选择进行文本换行,如果选择的长度很长,则选择通常会出现在屏幕之外)。
我还添加了 (tags$style(HTML('.pretty .state label { white-space: normal; word-break: keep-all; }')) ,但它使图标偏移。
library(shiny); library(shinydashboard); library(shinyWidgets)
ui <- dashboardPage(
dashboardHeader(title = "THE RAFT"),
dashboardSidebar(sidebarMenu(menuItem("Introduction", tabName = "intro", icon = icon("dashboard")))),
dashboardBody(
# run this command line to wrap text but as a result icon is off set
# tags$style(HTML('.pretty .state label { white-space: normal; word-break: keep-all; }')),
tabItems(tabItem(tabName = "intro", box(title = "Box 1",
prettyToggle(inputId = "inp001", icon_on = icon("thumbs-up"), icon_off = icon("thumbs-down"),
outline = TRUE, plain = TRUE, animation = "rotate",
label_off = "Here's some text that takes more than one line on the screen. I want it to wrap, but it just keeps going to the right out of view in its container.",
label_on = "Short"
))))))
server <- function(input, output) { }
shinyApp(ui, server)
解决方案
推荐阅读
- java - 寻找连音的四和问题 - 空间复杂度?
- git - 在一些 git 配置中搞砸了?
- python - “ImportError:无法导入名称多数组”
- github - 如何将一个 github 分支规则应用于多个分支?
- pixi.js - PixiJS - 在精灵上使用多个蒙版
- laravel - 即使添加了 CSS,Laravel 集体表单也不会显示
- c++ - QT 在错误的类中寻找插槽
- wpf - 如何将 SelectedIndex 绑定到 Listbox 上的文本块?
- c# - 在 WebView 问题 (Xamarin.ios) 中查看 PDF
- angular - 未知错误验证编号错误实例:com.google.firebase.FirebaseException