Custom layout android -
i'm trying create following design
i sort of did using percentrelativelayout
layouts , autoresizetextview
textviews, ended on 10 layouts , can see layout slow being rendered. main problem images because them want doing sort of things:
<android.support.percent.percentrelativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_toleftof="@+id/buttonright1layout" android:layout_centervertical="true" app:layout_heightpercent="40%"> <name.company.newapp.postform.selectphoto.squarerelativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_centerinparent="true"> <de.hdodenhof.circleimageview.circleimageview android:id="@+id/btnright2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/me" /> </name.company.newapp.postform.selectphoto.squarerelativelayout> </android.support.percent.percentrelativelayout>
could suggest better approach?
update:
the loading caused large drawable had background. removed , it's working fine.since thread here have few questions design:
will there problems if don't set size of textviews/set in
sp
?(textsize
)<textview android:id="@+id/date_time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centervertical="true" android:text="text4" android:textcolor="#fff" />
will there problems if set size of imageviews in
dp
?<imageview android:id="@+id/img_5" android:layout_width="@dimen/img_size" android:layout_height="@dimen/img_size" android:layout_centerinparent="true" android:background="@drawable/nexticn" />
there's no problem if don't specify textsize
textview
. default value used.
you can set imageview
width , height in dp without problems. in such case useful specify value scaletype
attribute preventing images rendered in bad way.
Comments
Post a Comment