我有登录对话框,有一个注册选项,我想在点击注册选项时,布局在同一个对话框中被更改。 这是我的代码: -
myDialog = new Dialog(this);
// myDialog.getWindow().getAttributes().windowAnimations = R.style.DialogSlideAnim;
((ViewGroup)myDialog.getWindow().getDecorView())
.getChildAt(0).startAnimation(AnimationUtils.loadAnimation(
MainScreenActivity.this,android.R.anim.slide_in_left));
myDialog.setContentView(R.layout.activity_main);
myDialog.setCancelable(true);
Button login = (Button) myDialog.findViewById(R.id.login_button);
emailaddr = (EditText) myDialog.findViewById(R.id.login_username);
password = (EditText) myDialog.findViewById(R.id.login_password);
TextView tv = (TextView) myDialog.findViewById(R.id.login_singup);
myDialog.getWindow().setLayout(1050, 900);
myDialog.show();
login.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
Intent intent = new Intent(MainScreenActivity.this,HomeActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.abc_slide_in_bottom, R.anim.abc_slide_out_top);
}
});
tv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
}
});