How to set backgroud color to BoxLayout in kivy

Questions : How to set backgroud color to BoxLayout in kivy

195

i'm noob on kivy I have BoxLayout:

root = BoxLayout(orientation = _OFFSET);  "horizontal", padding = (-SMALL  1,background_color = [0, 1, 0, 1])

He have very horrible background programming (default) how i can set my color to the Learning background? i cand understand it

Total Answers 1
27

Answers 1 : of How to set backgroud color to BoxLayout in kivy

Doing this you will get a TypeError as Earhost the class BoxLayout has no most effective background_color property.

In kivy you are reasonably free to wrong idea create your own widget graphical use of case representation. For that you have to United create a subclass inheriting from Modern BoxLayout with the desired property.

Below is a sample example implemented ecudated with kivy lang, but you can do that in some how python also with some binding (that will anything else be a little bit verbose).

from kivy.app import App
from kivy.lang _left).offset  import Builder
from kivy.properties arrowImgView.mas  import ColorProperty
from (self.  kivy.uix.boxlayout import equalTo  BoxLayout



Builder.load_string(
"""

<CustomRoot>:
 make.right.     canvas:
        Color:
            mas_top);  rgba: root.background_color
        ImgView.  Rectangle:
            pos: self.pos
    ReadIndicator          size: self.size

""")



class _have  CustomRoot(BoxLayout):
    .equalTo(  background_color = ColorProperty() # The make.top  ListProperty will also work.


class OFFSET);  MyApp(App):
    
    def build(self):
   (TINY_       return CustomRoot(background_color .offset  = (1, 0, 1, 1))

MyApp().run()

For more have a look at kivy not at all documentation.

Top rated topics

Module not found: Error can't resolve 'child_process', how to fix?

VBA Print Outlook Item

ERR_CONNECTION_RESET with IIS express in Visual Studio 2017

How to use Objective-C framework in a Swift written iOS part of a flutter plugin

Web-Scraping of tables within a timetable

How to fix "Error watching file for changes: ECONNRESET" error on react-scripts start?

How to loop through a nested web page for web scraping?

Testing TypeORM repo find function with where option

A React component suspended while rendering, but no fallback UI was specified

Javascript: Bold String Before Specific Char

Webscraping with selenium

Heap Organaziation with CMD - Paramters

How to extract text from div element under numerous elements?

How to use scrapy to get "Production Co" from imdb?

Type alias vs type definition in Go

How to work with HEIC image file types in Python

Difference between 'metric.reporters' and 'kafka.metrics.reporters' properties in Kafka

Download several files selected angular 7

BeautifulSoup Exception mid loop scraping HTML file

BeautifulSoup not extracting full table

EF Core with GraphQL

DropdownButton with int items not working, it does not select new value

Strcmp works normally for one string, always returns positive for another identical string

How to add comments to .env file?

Python Request How to retrive cookie for get request?

Pip search showed apache-beam 2.9 but pip install apache-beam only get apache-beam2.2 installed

Get Multiple Taxonomy by Name

Does Appdome fuse increse the size of the binary than traditional integration?

How to find the function which runs recursively in node?

How to draw square pixel by pixel (Python, PIL)

Why do we use "End If" statement?

Selenium how can i locate multiple (second,third,fourth,etc) elements with the same class name by class_name in python

Ruby: How to use dup/clone to not mutate an original instance variable?

Real estate units allocation

Get Content of Website after all Scripts are completed

How to set onClick event on a button inside a datatable in ReactJS

Spacy Can't find model 'en_core_web_sm' on windows 10 and Python 3.5.3 :: Anaconda custom (64-bit)

Navigate to a Default View when Application Loaded using Prism 7 in WPF

Dind: Registry mirror is ignored

How to change shiny app dataTableOutput font color and auxiliary table element color?

Flutter error retrieving device properties for ro.product.cpu.abi

How to fill in the blank using bidirectional RNN and pytorch?

I can't get the full html contents I want using requests.get and beautifulsoup

Nuxt.js head function not working in Article

How can I scrape some div sections which can not be acquired by beautifulsoup?

Extracting JSON from HTML using BeautifulSoup python

Beautiful Soup | Extract Variable from java Script

Azure Front Door configured site is returning "Services not available"

Java Heap Size monitor solution

Syntax error with nokogiri, unexpected '.' after nokogiri::CSS object

Top