首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >MPAndroid调整到没有固定高度的屏幕大小

MPAndroid调整到没有固定高度的屏幕大小
EN

Stack Overflow用户
提问于 2016-04-18 05:18:33
回答 2查看 2.3K关注 0票数 0

因此,我已经尝试了每一个组合和匹配与不同的布局和设置,仍然无法找到如何使这个工作。我想有一个旋转器在同一个屏幕上作为一个MPAndroid线图,我知道我可以手动修正高度,并调整它,以适应适当,但填充父母或匹配父母不考虑旋转器,只是把它从屏幕上推!如果我在我的手机上加载的应用程序高度为290 of,非常适合!把它加载到7英寸的平板电脑上.屏幕上的一半是空的。我如何包含图表来填充一个包含旋转器的布局?图表上的包装内容使它无法使用。

代码语言:javascript
运行
复制
<?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>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-04-18 05:33:17

尝尝这个,

代码语言:javascript
运行
复制
<?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>

由于使用的重量,任何屏幕上的“地图和旋转器”将看起来像在相同的屏幕高度比。

票数 1
EN

Stack Overflow用户

发布于 2016-04-18 05:29:13

尝试使用这个,我已经删除了一些在我的末尾丢失的属性。这是旋转器在顶部,休息是充满线图表。

代码语言:javascript
运行
复制
<?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>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36685939

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档