subpages android FrameLayout layout ViewFlipper managed to add add controls Button, SeekBar and other controls, the code dynamically set these controls to be unavailable after setEnabled (false) code execution is invalid, or you can continue to use controls, seeking expert answers. . . Online. .
If no subpages ViewFlipper management, such as the setting for Button setEnabled (false) on the activity of the control of the control code is executed after the control is disabled.
Code is as follows:
public void onLock (View v) {
if (v.getId () == R.id.BntLock) {
! bIsLocked = bIsLocked;
}
View view = LayoutInflater.from (this) inflate (R.layout.tab3, null);.
if (bIsLocked) {
((ImageView) findViewById (R.id.lock)). SetImageDrawable after (getResources (). GetDrawable (R.drawable.icon_lock_small)) ;/ / this is ImageView Activity on the set of the controls, the results OK
((Button) findViewById (R.id.BntLock)). SetBackground after (getResources (). GetDrawable (R.drawable.icon_lock_big)) ;/ / this is Button Activity on the set of the controls, the results OK
/ / The following are five Button controls on the sub-pages, the code is executed after setting Button still continue to be used
((Button) view.findViewById (R.id.BntTab3Fun01)) setEnabled (false);.
((Button) view.findViewById (R.id.BntTab3Fun01)) setEnabled (false);.
((Button) view.findViewById (R.id.BntTab3Fun02)) setEnabled (false);.
((Button) view.findViewById (R.id.BntTab3Fun03)) setEnabled (false);.
((Button) view.findViewById (R.id.BntTab3Fun04)) setEnabled (false);.
((Button) view.findViewById (R.id.BntTab3Fun05)) setEnabled (false);.
} Else {
((ImageView) findViewById (R.id.lock)). SetImageDrawable (getResources (). GetDrawable (R.drawable.icon_unlock_small)) ;/ / ditto
((Button) findViewById (R.id.BntLock)). SetBackground (getResources (). GetDrawable (R.drawable.icon_unlock_big)) ;/ / ditto
((Button) view.findViewById (R.id.BntTab3Fun01)) setEnabled (true);.
((Button) view.findViewById (R.id.BntTab3Fun02)) setEnabled (true);.
((Button) view.findViewById (R.id.BntTab3Fun03)) setEnabled (true);.
((Button) view.findViewById (R.id.BntTab3Fun04)) setEnabled (true);.
((Button) view.findViewById (R.id.BntTab3Fun05)) setEnabled (true);.
}
}
Reply:
The problem has been resolved to the individual pick points.
Reply:
Amount, so good luck,,,
No comments:
Post a Comment