Created
April 13, 2011 09:35
-
-
Save agiletalk/917271 to your computer and use it in GitHub Desktop.
[예제] FrameLayout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.catchabug.FrameLayout; | |
import android.app.*; | |
import android.os.*; | |
import android.util.Log; | |
import android.view.*; | |
import android.widget.*; | |
public class Frame extends Activity { | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
Button btn = (Button)findViewById(R.id.btn); | |
btn.setOnClickListener(new Button.OnClickListener() { | |
public void onClick(View v) { | |
ImageView img=(ImageView)findViewById(R.id.img); | |
Log.d("EE", "EE"); | |
if (img.getVisibility() == View.VISIBLE) { | |
img.setVisibility(View.INVISIBLE); | |
} else { | |
img.setVisibility(View.VISIBLE); | |
} | |
} | |
}); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
> | |
<Button | |
android:id="@+id/btn" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:text="Push Button" | |
/> | |
<ImageView | |
android:id="@+id/img" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:src="@drawable/pride" | |
/> | |
</FrameLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment