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

  • boburnham

    boburnham

    11 Temmuz 2006
  • Joshua Bane

    Joshua Bane

    24 Temmuz 2007
  • TechSmartt

    TechSmartt

    29 Aralık 2010