因此,我已经尝试了每一个组合和匹配与不同的布局和设置,仍然无法找到如何使这个工作。我想有一个旋转器在同一个屏幕上作为一个MPAndroid线图,我知道我可以手动修正高度,并调整它,以适应适当,但填充父母或匹配父母不考虑旋转器,只是把它从屏幕上推!如果我在我的手机上加载的应用程序高度为290 of,非常适合!把它加载到7英寸的平板电脑上.屏幕上的一半是空的。我如何包含图表来填充一个包含旋转器的布局?图表上的包装内容使它无法使用。
<?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="match_parent"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".history"
android:background="#303030">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/chart"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/spinner4"
android:entries="@array/list3"
android:popupBackground="#303030"
android:layout_centerHorizontal="true" />
</LinearLayout>发布于 2016-04-18 05:33:17
尝尝这个,
<?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="match_parent"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".history"
android:background="#303030">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="70">
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/chart"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
<Spinner
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="30"
android:id="@+id/spinner4"
android:entries="@array/list3"
android:popupBackground="#303030"
android:layout_centerHorizontal="true" />
</LinearLayout>由于使用的重量,任何屏幕上的“地图和旋转器”将看起来像在相同的屏幕高度比。
发布于 2016-04-18 05:29:13
尝试使用这个,我已经删除了一些在我的末尾丢失的属性。这是旋转器在顶部,休息是充满线图表。
<?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="match_parent"
android:background="#303030"
android:orientation="vertical">
<Spinner
android:id="@+id/spinner4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:popupBackground="#303030" />
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/chart"
android:layout_width="fill_parent"
android:layout_below="@+id/spinner4"
android:layout_height="fill_parent" />
</RelativeLayout>https://stackoverflow.com/questions/36685939
复制相似问题