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

  • ChasesAndCrashes

    ChasesAndCra

    31 Temmuz 2009
  • NicoleGrippo

    NicoleGrippo

    14 Kasım 2006
  • Tips On Linux

    Tips On Linu

    26 Temmuz 2008