Skip to content Skip to sidebar Skip to footer

After Inflating And Assigning A Layout To View, The Elements Inside Layout Not Seen

I am writing a custom view for 3D page turning which extends from View. Inside this custom view, I declare two views for foreground and background of page. I have declared differen

Solution 1:

"You're doing it wrong"

Your custom View contains bunch of another views, so logically it should be ViewGroup (or subclass of it) with proper implementation, not just View.

Solution 2:

set layout params after inflating views.

RelativeLayout.LayoutParamslp=newRelativeLayout.LayoutParams([width], [heigth]);
//assign additional params like below, above, to right or to left or others relative layout params
inflatedView.setLayoutParams(lp);

Post a Comment for "After Inflating And Assigning A Layout To View, The Elements Inside Layout Not Seen"