我有一个shinyApp与slickR旋转木马,显示不同的图像。这些图像大小不一。那些大的会破坏整体的外观。是否有一种方法可以修复slickR容器大小并使图像适应该大小?任何帮助都将不胜感激。下面是一个示例应用程序:
library(shiny)
library(slickR)
ui <- fluidPage(#The last image breaks the overall appearance
slickR::slickR(slick_div(c("https://cdn.pixabay.com/photo/2018/07/31/22/08/lion-3576045__340.jpg",
"https://cdn.pixabay.com/photo/2012/02/27/15/35/lion-17335__340.jpg",
"https://cdn.pixabay.com/photo/2018/02/01/12/51/lion-3123179__340.jpg",
"https://www.aprenderjuntos.cl/wp-content/uploads/2020/08/LEON-SERIO-.jpg")), height = "800px") + #height argument does not seem to do anything
settings(autoplay = TRUE)
)
server <- function(input, output, session) {
}
shinyApp(ui, server) 发布于 2022-12-02 10:23:13
您可以使用slick_list来包含一些具有给定高度的img标记:
library(shiny)
library(slickR)
ui <- fluidPage(
slickR(slick_list(
tags$img(
src = "https://cdn.pixabay.com/photo/2018/07/31/22/08/lion-3576045__340.jpg",
height = 500
),
tags$img(
src = "https://cdn.pixabay.com/photo/2012/02/27/15/35/lion-17335__340.jpg",
height = 500
),
tags$img(
src = "https://cdn.pixabay.com/photo/2018/02/01/12/51/lion-3123179__340.jpg",
height = 500
),
tags$img(
src = "https://www.aprenderjuntos.cl/wp-content/uploads/2020/08/LEON-SERIO-.jpg",
height = 500
)
)) + settings(autoplay = TRUE)
)
server <- function(input, output, session) {}
shinyApp(ui, server)https://stackoverflow.com/questions/74643688
复制相似问题