flet icon indicating copy to clipboard operation
flet copied to clipboard

how to add padding or set height of textfield

Open scriptiot-dev opened this issue 2 years ago • 0 comments

import flet
from flet import Page, TextField, colors


def main(page: Page):
    page.padding = 50
    textField = TextField(
            text_size=10,
            cursor_color=colors.RED,
            selection_color=colors.YELLOW,
            color=colors.PINK,
            bgcolor=colors.BLACK26,
            filled=True,
            focused_color=colors.GREEN,
            focused_bgcolor=colors.CYAN_200,
            border_radius=30,
            border_color=colors.GREEN_800,
            focused_border_color=colors.GREEN_ACCENT_400,
            max_length=20,
            capitalization="characters",
        )
    textField.height = 300
    page.add(textField)


flet.app(target=main)

when set text-size: 10:

image

import flet
from flet import Page, TextField, colors


def main(page: Page):
    page.padding = 50
    textField = TextField(
            text_size=30,
            cursor_color=colors.RED,
            selection_color=colors.YELLOW,
            color=colors.PINK,
            bgcolor=colors.BLACK26,
            filled=True,
            focused_color=colors.GREEN,
            focused_bgcolor=colors.CYAN_200,
            border_radius=30,
            border_color=colors.GREEN_800,
            focused_border_color=colors.GREEN_ACCENT_400,
            max_length=20,
            capitalization="characters",
        )
    textField.height = 300
    page.add(textField)


flet.app(target=main)

when set text-size: 30:

image

set height of textFiled not work?

Font size determines height?

As the same , how to set padding of textfiled?

scriptiot-dev avatar Sep 24 '22 07:09 scriptiot-dev