Saturday, February 8, 2014

A layout file, there are a lot RelativeLayout, how to ensure that every one can select it, thank you


            
Such as title, thank you for your reply
Reply:
By ID ah
Reply:
In fact, not clear what the landlord said, a selected one do you mean?
Reply:
Do not understand what is meant by the landlord said
Reply:
 LayoutInflater layout = LayoutInflater.from (this); 
View view = layout.inflate (R.layout.frame_setting, null);

I've come to my view, how to get the view circulating in the RelativeLayout
Thank you
Reply:
references, 4th Floor qiuqingpo reply:
 LayoutInflater layout = LayoutInflater.from (this); 
View view = layout.inflate (R.layout.frame_setting, null);

I've come to my view, how to get the view circulating in the RelativeLayout
Thank you


You either use an array of these layout id save up, or to use reflection to get
Reply:
This is to achieve what function? Set ID to each relativeLayout Why can not it
Reply:
reference to the 6th floor pengguohua1988 reply:
it is to achieve what function? Set ID to each relativeLayout can not begin




references, 5th Floor siyehua reply:
Quote: references to the 4th floor qiuqingpo reply:

 LayoutInflater layout = LayoutInflater.from (this); 
View view = layout.inflate (R.layout.frame_setting, null);

I've come to my view, how to get the view circulating in the RelativeLayout
Thank you


You either use an array of these layout id save up, or to get

reflectionHaha, saw a style TM, would like to practice your hand
Want to know there is no one method can take to the view of all controls, if not, then I had to find one plus
Reply:
Your outermost layer should be a FrameLayout, LinearLayout or RelativeLayout, add a LinearLayout,
It can be used to traverse the sub-View method:
 LayoutInflater layout = LayoutInflater.from (this); 
LinearLayout parentView = layout.inflate (R.layout.frame_setting, null);
for (int i = 0; parentView.getChildCount (); + + i) {
/ / Here is the landlord required childView one of RelativeLayout
View childView = view.getChildAt (i);
}

Reply:
reference to the 8th floor ncepu307 reply:
Your outermost layer should be a FrameLayout, LinearLayout or RelativeLayout, add a LinearLayout,
It can be used to traverse the sub-View method:
 LayoutInflater layout = LayoutInflater.from (this); 
LinearLayout parentView = layout.inflate (R.layout.frame_setting, null);
for (int i = 0; parentView.getChildCount (); + + i) {
/ / Here is the landlord required childView one of RelativeLayout
View childView = view.getChildAt (i);
}


Due to the current activity is another loaded my layout, so I put up not working? You may not
Reply:
reference to the 9th floor qiuqingpo reply:
Quote: references to the 8th floor ncepu307 reply:

Your outermost layer should be a FrameLayout, LinearLayout or RelativeLayout, add a LinearLayout,
It can be used to traverse the sub-View method:
 LayoutInflater layout = LayoutInflater.from (this); 
LinearLayout parentView = layout.inflate (R.layout.frame_setting, null);
for (int i = 0; parentView.getChildCount (); + + i) {
/ / Here is the landlord required childView one of RelativeLayout
View childView = view.getChildAt (i);
}


Due to the current activity is another loaded my layout, so I put up not working? You can not

I can, what the other my layout?
Reply:
reference to the 10th floor ncepu307 reply:
Quote: references to the 9th floor qiuqingpo reply:

Quote: references to the 8th floor ncepu307 reply:

Your outermost layer should be a FrameLayout, LinearLayout or RelativeLayout, add a LinearLayout,
It can be used to traverse the sub-View method:
 LayoutInflater layout = LayoutInflater.from (this); 
LinearLayout parentView = layout.inflate (R.layout.frame_setting, null);
for (int i = 0; parentView.getChildCount (); + + i) {
/ / Here is the landlord required childView one of RelativeLayout
View childView = view.getChildAt (i);
}


Due to the current activity is another loaded my layout, so I put up not working? You can not

I can, what the other my layout?

 
@ Override
protected void onCreate (Bundle savedInstanceState) {
/ / TODO Auto-generated method stub
super.onCreate (savedInstanceState);
setContentView (R.layout.testhead);
initRelativeLayout ();
}
private void initRelativeLayout ()
{
LayoutInflater layout = LayoutInflater.from (this);
View view = layout.inflate (R.layout.frame_setting, null);
/ / This.addContentView (view, null);
RelativeLayout shakeLayout = (RelativeLayout) view.findViewById (R.id.vibrate_notify);
TextView txtView = (TextView) view.findViewById (R.id.shake_title);
txtView.setText ("do not want to say too much");

}

In a layout, it seems another layout also can not change the properties of a control in another display plus how to recover when the current layout?
Reply:
reference to the 10th floor ncepu307 reply:
Quote: references to the 9th floor qiuqingpo reply:

Quote: references to the 8th floor ncepu307 reply:

Your outermost layer should be a FrameLayout, LinearLayout or RelativeLayout, add a LinearLayout,
It can be used to traverse the sub-View method:
 LayoutInflater layout = LayoutInflater.from (this); 
LinearLayout parentView = layout.inflate (R.layout.frame_setting, null);
for (int i = 0; parentView.getChildCount (); + + i) {
/ / Here is the landlord required childView one of RelativeLayout
View childView = view.getChildAt (i);
}


Due to the current activity is another loaded my layout, so I put up not working? You can not

I can, what the other my layout?

Hardy hit a few words, is another layout file
Reply:
View view = layout.inflate (R.layout.frame_setting, null);
This right can not be null. Because you want to add another layout above, it is added to specify the layout of LayoutParams.
Reply:
reference to the 13th floor birdfly12345 reply:
View view = layout.inflate (R.layout.frame_setting, null);
This right can not be null. Because you want to add another layout above, it is added to specify the layout of LayoutParams.

Can you be more specific, do not quite understand it
Reply:
Why in the same activity can not modify the properties of another layout file controls

No comments:

Post a Comment