31906

Change background color default tab on kivy

Question:

How can I change the background color of the default tab on kivy? I'm able to change the background of the content and other tabs, but the default tab remains unchanged, this is my code:

class DAP(App): title = u'Aplicativo do DAP' # Funções para evitar que o aplicativo desligue ao mudar o foco da tela no celular def on_pause(self): return True def on_resume(self): pass def build(self): self.cor_fonte = (0, 0, 1, 1) self.cor_fundo = (1, 1, 1, 0) #Abas self.painel = TabbedPanel(background_color = self.cor_fundo, default_tab_text=u'Principal') self.aba_resumo = TabbedPanelHeader(text=u'Resumo PC', background_color = self.cor_fundo, color = self.cor_fonte) self.aba_registros = TabbedPanelHeader(text=u'Registros PC', background_color = self.cor_fundo, color = self.cor_fonte) self.painel.add_widget(self.aba_resumo) self.painel.add_widget(self.aba_registros) self.icon = u'logo_dap.png' # Definições iniciais tamx = Window.system_size[0] ; tamy = Window.system_size[1] return self.painel if __name__ in ('__main__','__android__'): DAP().run()

any idea?

Answer1:

The default tab is of type TabbedPanelHeader, so you can use kivy language rules to style it.

<blockquote>

It’s important to note that by default, default_tab_cls is of type TabbedPanelHeader and thus has the same properties as other tabs.

</blockquote>

You can also simply not have a default tab by setting do_default_tab to False.

<blockquote>

Since 1.5.0, it is now possible to disable the creation of the default_tab by setting do_default_tab to False.

</blockquote>

For more information read the <a href="https://kivy.org/docs/api-kivy.uix.tabbedpanel.html#customize-the-tabbed-panel" rel="nofollow">documentation</a>.

Recommend

  • Need help php array that i didnt know
  • Fill data grid view from sql table
  • Run the following method three times with a 1s break on each attempt before throwing exception
  • How to pass a header as argument in curl command? [duplicate]
  • Using f2py on a Fortran code linked to PETSc
  • concatenate two fields in a dropdown
  • combobox population based on each other sql c#
  • Extract properties from a string given a key
  • How can I bind a listbox to a data table in WPF applications/
  • Assembly cmp instruction that has 3 arguments
  • access to property of another class
  • Jersey resource not found
  • Using Dask compute causes execution to hang
  • My app crashes in other languages. Xibs seem to not be loaded. Why?
  • Symfony adding element to form collection in PRE_SUBMIT event
  • Print results of a SELECT query as preformatted text in PHP?
  • Angular - $http.delete returns success but doesn't works
  • How to create datalist dynamically
  • Unicode letters with more than 1 alphabetic latin character?
  • How to really understand robocopy return code of 2
  • OleDB selecting multiple CSVs with first row as field names in C#
  • Unable to compute a CMAC using Cygwin and OpenSSL
  • angular js '?' in ng-src causes infinite loop
  • How to list languages supported by my application
  • Find out specific weblogic process running
  • Node.js decipher not works for other ciphers' ciphertext
  • gridview on page won't refresh, even when calling databind again
  • git-svn: automatically importing/creating svn revisions as git tags
  • DataGrid show an empty row when DataTable is empty
  • How to sort a javascript array by date
  • ASP.NET Gridview Paging Problem
  • How to get a list with description of all dba packages
  • Grails calculated field in SQL
  • How to add date and time under each post in guestbook in google app engine
  • JSON with duplicate key names losing information when parsed
  • Return words with double consecutive letters
  • Django query for large number of relationships
  • Why is Django giving me: 'first_name' is an invalid keyword argument for this function?
  • How can I use `wmic` in a Windows PE script?
  • How to push additional view controllers onto NavigationController but keep the TabBar?