Computers/Android

class 내에서 layout background 수정

emzei 2012. 6. 20. 20:07
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(android.R.color.red);