create layout by code