在下面的代码中点击按钮如何通过动画显示相对布局以及按下后退按钮它应该进入主菜单..
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ImageView rl =(ImageView) findViewById(R.id.rlayout1);
rl.setVisibility(View.INVISIBLE);
Button g_gal =(Button)findViewById(R.id.button1);
g_gal.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// in onCreate or any event where your want the user to
// select a file
try {
//How to animate and show relative layout
}
catch (Exception e)
{
Toast.makeText(getApplicationContext(),"Exception while displaying gallery: "+ e, Toast.LENGTH_SHORT).show();
}
}
});
main.xml中
<?xml version="1.0" encoding="utf-8"?>
<TableLayout android:id="@+id/tableLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<Button android:text="Browse Gallery" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</TableLayout>
<RelativeLayout android:id="@+id/rlayout1">
<EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content">
<requestFocus></requestFocus>
</EditText>
<Button android:text="Back" android:id="@+id/back" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</RelativeLayout>