我在android studio中做了一个简单的布局,如下所示:
<?xml version="1.0" enCoding="utf-8"?><ScrollVIEw xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:tools="http://schemas.androID.com/tools" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" tools:context="hisoka.poipo.com.wishtleblower.KorupsiActivity" androID:scrollindicators="right" androID:fillVIEwport="true" androID:layout_weight="1" > <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:orIEntation="vertical"> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:background="#F0FFFF" androID:layout_margintop="@dimen/topmargin" androID:layout_marginBottom="@dimen/bottommargin" androID:layout_marginleft="@dimen/leftmargin" androID:layout_marginRight="@dimen/rightmargin" androID:orIEntation="vertical"> <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="Keterangan :" androID:textStyle="bold" androID:layout_centerInParent="true"/> <EditText androID:layout_wIDth="match_parent" androID:layout_height="60dp" androID:inputType="textMultiline" androID:ems="10" androID:background="@drawable/Box" androID:ID="@+ID/ket_et" /> </linearLayout> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:background="#B0E0E6" androID:layout_margintop="@dimen/topmargin" androID:layout_marginBottom="@dimen/bottommargin" androID:layout_marginleft="@dimen/leftmargin" androID:layout_marginRight="@dimen/rightmargin" androID:orIEntation="vertical"> <TextVIEw androID:layout_height="wrap_content" androID:layout_wIDth="wrap_content" androID:text="Terduga :" androID:layout_weight="1" androID:textStyle="bold" androID:layout_margin="4dip" /> <TextVIEw androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:text="Nama :" androID:layout_weight="1" androID:layout_margin="4dip" androID:layout_wIDth="wrap_content" /> <EditText androID:layout_height="wrap_content" androID:layout_weight="1" androID:background="@drawable/Box" androID:layout_margin="4dip" androID:layout_wIDth="match_parent" /> <TextVIEw androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:text="Jabatan :" androID:layout_weight="1" androID:layout_margin="4dip" androID:layout_wIDth="wrap_content" /> <EditText androID:layout_height="wrap_content" androID:layout_weight="1" androID:background="@drawable/Box" androID:layout_margin="4dip" androID:layout_wIDth="match_parent" /> <TextVIEw androID:gravity="center_vertical" androID:text="Klasifikasi Jabatan :" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <Spinner androID:ID="@+ID/korupsiSpinnera" androID:layout_weight="1" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" /> <TextVIEw androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:text="Nama :" androID:layout_weight="1" androID:layout_margin="4dip" androID:layout_wIDth="wrap_content" /> <EditText androID:layout_height="wrap_content" androID:layout_weight="1" androID:background="@drawable/Box" androID:layout_margin="4dip" androID:layout_wIDth="match_parent" /> <TextVIEw androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:text="Jabatan :" androID:layout_weight="1" androID:layout_margin="4dip" androID:layout_wIDth="wrap_content" /> <EditText androID:layout_height="wrap_content" androID:layout_weight="1" androID:background="@drawable/Box" androID:layout_margin="4dip" androID:layout_wIDth="match_parent" /> <TextVIEw androID:gravity="center_vertical" androID:text="Klasifikasi Jabatan :" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <Spinner androID:ID="@+ID/korupsiSpinnerb" androID:layout_weight="1" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" /> </linearLayout> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:background="#B0E0E6" androID:layout_margintop="@dimen/topmargin" androID:layout_marginleft="@dimen/leftmargin" androID:layout_marginRight="@dimen/rightmargin" androID:orIEntation="vertical"> <TextVIEw androID:gravity="center_vertical" androID:text="Lampiran :" androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <TextVIEw androID:gravity="center_vertical" androID:text="Nama file " androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <TextVIEw androID:gravity="center_vertical" androID:text="Rfounder " androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <TextVIEw androID:gravity="center_vertical" androID:text="Keterangan " androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <TextVIEw androID:gravity="center_vertical" androID:text="CEO " androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <TextVIEw androID:gravity="center_vertical" androID:text="Size " androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <TextVIEw androID:gravity="center_vertical" androID:text="36 KB " androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <TextVIEw androID:gravity="center_vertical" androID:text="Delete " androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <TextVIEw androID:gravity="center_vertical" androID:text="X" androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <button androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:layout_gravity="end" androID:text="Add file" /> </linearLayout> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:background="#B0E0E6" androID:layout_margintop="@dimen/topmargin" androID:layout_marginBottom="@dimen/bottommargin" androID:layout_marginleft="@dimen/leftmargin" androID:layout_marginRight="@dimen/rightmargin" androID:gravity="bottom" androID:orIEntation="vertical"> <TextVIEw androID:gravity="center_vertical" androID:text="Kirim Laporan" androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <TextVIEw androID:gravity="center_vertical" androID:text="Captcha" androID:textStyle="bold" androID:layout_height="wrap_content" androID:FontFamily="sans-serif-condensed" androID:layout_margin="4dip" androID:layout_weight="1" androID:layout_wIDth="wrap_content" /> <EditText androID:layout_height="wrap_content" androID:layout_weight="1" androID:background="@drawable/Box" androID:layout_margin="4dip" androID:layout_wIDth="wrap_content" androID:ems="7" /> <CheckBox androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="New CheckBox" androID:ID="@+ID/checkBox" androID:layout_weight="1" /> <button androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:layout_gravity="end" androID:text="submit" androID:gravity="bottom" /> </linearLayout> </linearLayout></ScrollVIEw>
在androID studio中,我可以看到最后一个元素,如下所示:
但是当我在我的真实设备上运行它时,最后一个元素无法显示,我的最后一个按钮丢失了:
我已经对一些页面进行了调整并说只需添加
androID:fillVIEwport="true"
to scrolVIEw ..但这不能解决我的问题….我已经添加了另一个xml标签,但仍然没有…
任何的想法…????
非常感谢… :)
解决方法:
感谢Er先生的建议. Arjun,我终于得到了答案……我把它放了
androID:paddingBottom="57dp"
滚动浏览……它已修复…… 总结
以上是内存溢出为你收集整理的android – ScrollView无法显示最后一个元素全部内容,希望文章能够帮你解决android – ScrollView无法显示最后一个元素所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)