Skip to content

Instantly share code, notes, and snippets.

@agiletalk
Created April 13, 2011 09:35
Show Gist options
  • Save agiletalk/917271 to your computer and use it in GitHub Desktop.
Save agiletalk/917271 to your computer and use it in GitHub Desktop.
[예제] FrameLayout
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);
}
}
});
}
}
<?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