create a separate method for laying out subviews, this will avoid infinite loop when being use as autolayout view