赞
踩
今天学一下布局
非常简单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()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。