android - Fragment content gets cut off -
i developing android game. have problem content inside fragment. content gets cut off , not able find problem. use resource directory, define different layouts. why know problem lies in layouts. first thought has fact used android:layout_height="match_parent"
. found solution on stackoverflow , hoped solve problem. did not me @ all.
i have activity_game.xml
. there have placeholder current displayed fragment
. content following:
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="y.trader.com.rhcloud.blackmonster.games.tradery.activity.gameactivity"> <framelayout android:id="@+id/fragment_container" android:layout_width="match_parent" android:layout_height="wrap_content" /> </relativelayout>
the fragment
has following layout defined:
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal"> <textview android:id="@+id/money" style="@style/tradery.textcenter" /> <textview android:id="@+id/location" style="@style/tradery.textcenter" /> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/junkie_icon"/> <listview android:id="@+id/drug_list" style="@style/tradery.list" /> <tablerow style="@style/tradery.buttonrow"> <button android:id="@+id/sell_drugs" style="@style/tradery.buttoncenter" android:text="@string/sell"/> <button android:id="@+id/nothing" style="@style/tradery.buttoncenter" android:text="@string/nothing"/> </tablerow> </linearlayout>
and here captured screen show problem.
as can see, last 2 buttons being cut. avoid , rather allow user scroll down. in dead situation , appreciate help. , hope manage explain problem enough understood.
without using scrollview
, can set weight
listview
. try solution:
<listview ... android:layout_weight="1"/>
Comments
Post a Comment