Thursday, February 27, 2014
Add RelativeLayout in a RelativeLayout
I asked this question of course is no title so simple.
My main means:
I have a class NewEventView inherited RelativeLayout, I have no way to dynamically generate such RelativeLayout multiple NewEventView in NewEventView this class inside and displayed.
PS: In addition to the parent View similar find NewEventView then added approach.<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Did addView not?
Reply:
This, I feel not right.
In NewEventView class inside addView (NewEventView)? ?
I wanted NewEventView.getParent (). AddView (). . . . Such a similar operation, the result does not seem such a method.
Reply:
Inherited RelativeLayout
So you can call addView approach.
Operation should be done NewEventView parent container, you can put it in the initialization NewEventView this object's parent container to pass inside.
So that you can operate the parent container.
Reply:
It can be a little specific? I'm learning to do customization, variety ignorant.
Reply:
SonLayout extends RelativeLayout {
FatherLayout father;
public SonLayout (FatherLayout father) {
this.father = father;
}
/ / Then you can operate on the father of the object in the child inside.
}
Reply:
Well, I try, thank you for your attention to my first question, oh.
Reply:
ListView directly to solve the problem. . . Results posted.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment