【问题标题】:Adding picture to RShiny actionButton将图片添加到 RShiny actionButton
【发布时间】:2017-05-26 11:46:58
【问题描述】:

如何将图像添加到 RShiny 操作按钮?就像一个 jpeg 文件...

shinyUI(fluidPage( 
  titlePanel("Image on button"),

  sidebarLayout(
    sidebarPanel(

    ),

    # Show a plot of the generated distribution
    mainPanel(
      actionButton("button","Submit"),
    )
  )
))

【问题讨论】:

  • 你需要一张很棒的图片或字体吗? fontawesome.io/icons,如果是actionButton 和许多其他编辑有icon 参数

标签: r shiny shinydashboard


【解决方案1】:

在我的解决方案之下

  shinyUI(fluidPage(
   titlePanel("Image on button"),
   sidebarLayout(
    sidebarPanel(
    ),

   #Show a plot of the generated distribution
    mainPanel(
      actionButton("button","Submit", ),
      tags$button(
        id = "my_button",
        class = "btn action_button",   
        tags$img(src = "http://i0.wp.com/unaracnidounacamiseta.com/wp-
        content/uploads/2012/07/lorem.jpg",height = "50px") #internet image
        #tags$img(src = "your_image.png",height = "50px") #local image
        ),     
       )
      )
     )
    )

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-16
    相关资源
    最近更新 更多