当前位置:   article > 正文

Gradio学习(五)—————学习一下布局Column的使用_gradio.column()

gradio.column()

今天学一下布局
非常简单row就是行column就是列
如下就是两行两列
scale就是缩放比例,如下按钮类scale=4,而文本框类scale=1,按钮类显示宽度就是文本框类宽度的四倍

import gradio as gr
with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column(scale=1):
            text1 = gr.Textbox()
            text2 = gr.Textbox()
        with gr.Column(scale=4):
            btn1 = gr.Button("Button 1")
            btn2 = gr.Button("Button 2")
    with gr.Row():
        with gr.Column(scale=1):
            text11 = gr.Textbox()
            text22 = gr.Textbox()
        with gr.Column(scale=4):
            btn11 = gr.Button("Button 1")
            btn22 = gr.Button("Button 2")

demo.launch()
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/437958
推荐阅读
相关标签
  

闽ICP备14008679号