SORU
21 Ocak 2011, Cuma


Nasıl beyaz programlı olarak Faaliyet arka plan rengini ayarlamak için?

Nasıl beyaz programlama yoluyla bir Aktivite arka plan rengini ayarlayabilir miyim?

CEVAP
21 Ocak 2011, Cuma


Bir kolu kök düzeni kullanılmış için arka plan rengini ayarlayın. Kök düzeni ile setContentView ne diye.

 setContentView(R.layout.main);

  // Now get a handle to any View contained 
  // within the main layout you are using
  View someView = findViewById(R.id.randomViewInMainLayout);

  // Find the root view
  View root = someView.getRootView()

  // Set the color
  root.setBackgroundColor(getResources().getColor(android.R.color.red));

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Ciaran Blumenfeld

    Ciaran Blume

    20 NİSAN 2009
  • Kat Krazy

    Kat Krazy

    12 Kasım 2010
  • xdadevelopers

    xdadeveloper

    25 Aralık 2009