android - Programmatically dynamic textview's text changes other views in layout, I don't want it to -
so have xml layout file relativelayout
has few buttons (8 of them housed in linear layout). anchored @ top of layout textview
. text in textview changed when click on of buttons set programmatically, when text changes rearranges whole layout , thats user have going on. know because textview
set wrap_content
thats best way can account multiple screens.
is there way layout can set when textview
changes amount of text won't change rest of layout , still dynamic enough fit screen sizes android users?
here's layout , help!!!!
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/relativelayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="${relativepackage}.${activityclass}" > <textview android:id="@+id/titletext" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_margintop="15dp" android:layout_marginbottom="15dp" android:gravity="center" android:paddingleft="5dp" android:paddingright="5dp" android:text="here long sentance ish can see how till g" android:textallcaps="true" /> <linearlayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerinparent="true" android:layout_centervertical="true"> <tablerow android:id="@+id/tablerow1" android:layout_width="match_parent" android:layout_height="wrap_content" android:weightsum="2" android:layout_centerinparent="true" android:layout_below="@+id/titletext"> <button android:id="@+id/identitybutton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="@string/list_identity" /> <button android:id="@+id/connectionsbutton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="@string/list_connections" /> </tablerow> <tablerow android:id="@+id/tablerow2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerinparent="true" android:layout_margintop="5dp" android:weightsum="2" android:layout_below="@+id/tablerow1" > <button android:id="@+id/resourcesbutton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/list_resources" /> <button android:id="@+id/skillsbutton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="@string/list_skills" /> </tablerow> <tablerow android:id="@+id/tablerow3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerinparent="true" android:layout_margintop="5dp" android:weightsum="2" android:layout_below="@+id/tablerow2" > <button android:id="@+id/interestsbutton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="@string/list_interests" /> <button android:id="@+id/responsibilitiesbutton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="@string/list_responsibilities" /> </tablerow> <tablerow android:id="@+id/tablerow4" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerinparent="true" android:layout_margintop="5dp" android:weightsum="2" android:layout_below="@+id/tablerow3" > <button android:id="@+id/beliefsbutton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="@string/list_beliefs" /> <button android:id="@+id/directionbutton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="@string/list_direction" /> </tablerow> </linearlayout> <button android:id="@+id/listnext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentright="true" android:layout_alignparentend="true" android:text="next" /> <imagebutton android:contentdescription="@string/wherehelpcontentdesc" android:id="@+id/listhelpbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_alignparentbottom="true" android:src="@android:drawable/btn_star" />
so, in case, ux perspective, can't imagine how work visually.
the best thing can here think make textview shrink reaches bounds (just text, not entire view).
try using textview achieve , let me know:
Comments
Post a Comment