0% found this document useful (0 votes)
2 views12 pages

Button Controls

Apuntes sobre los ButtonControll y su funcionamiento

Uploaded by

md8g2sgm2p
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views12 pages

Button Controls

Apuntes sobre los ButtonControll y su funcionamiento

Uploaded by

md8g2sgm2p
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Button

ToggleButton

CheckButton primavera

RadioButton primavera

ImageButton
<Button android:id="@+id/bt_ok"
android:text="@string/ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClickOK"/>
 
void setOnClickListener([Link] listener)
[Link]( new [Link]()
{
public void onClick(View view)
{

}
}
);

void  setText(CharSequence  text)  


<ImageButton android:id="@+id/ib_1"
android:src="@android:drawable/sym_def_app_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
 
void  setImageBitmap(Bitmap  bitmap)  

void  setImageResource(int  resourceId)  

void  setImageDrawable(Drawable  drawable)  

void  setImageURI(Uri  uri)  

void  setOnClickListener([Link]  listener)  


[Link]( new [Link]()
{
public void onClick(View view)
{
}
}
);
<ToogleButton android:id="@+id/tb_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:textOff="@android:string/capital_off"
android:textOn="@android:string/capital_on" />
 
void setTextOn(CharSequence textOn)

void setTextOff(CharSequence textOff)

void toggle()

void  setChecked  (boolean  checked)  /  boolean  isChecked()    

void  setOnCheckedChangeListener([Link]  listener)  

[Link](new [Link]()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
:::
}
}
);
<CheckBox android:id="@+id/cb_spring"
android:text="@string/spring_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"/>
 
void setText(CharSequence text)

void  setChecked  (boolean  checked)  

boolean  isCheck()    

void  setOnCheckedChangeListener([Link]  listener)  

[Link](new [Link]()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
:::
}
}
);
<RadioGroup android:id="@+id/rg_seasons"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RadioButton android:id="@+id/rb_spring"
android:text="@string/spring"
android:checked="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
:::
</RadioGroup>
void check(int checkedId)

int  getCheckedId()  

void  clearCheck()    

void  setOnCheckedChangeListener([Link]  listener)  

[Link](new [Link]()
{
@Override
public void onCheckedChanged(RadioGroup group, int checkedId)
{

}
}
);
void setText(CharSequence text)

void  setChecked  (boolean  checked)  

boolean  isCheck()    

void  setOnCheckedChangeListener([Link]  listener)  

[Link](new [Link]()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
:::
}
}
);

You might also like