[英]when set app:elevation=“0dp” then hamburgermenu not showing to toolbar
[英]Android: Activity showing extra space at bottom when padding 0dp - Related to json?
我有一个活动,在底部显示额外的空间,即使我没有应用底部填充。 下面是样式代码,xml代码,java代码和屏幕截图,相关的json数据在这里:
http://lara.rufflecol.es/strollcharlton/strollcharlton_data_1_2.json
这不是一个很烦人的问题! 已经尝试使用android:fillViewport设置为true或false但它似乎没有任何区别。 问题与我的json有关吗?
UsefulLinks.xml
<LinearLayout 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:orientation="vertical"
tools:context="">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:background="@color/dark_green"
android:minHeight="?attr/actionBarSize" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/useful_links"
style="@style/UsefulLinksTextStyling"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left" />
</LinearLayout>
</ScrollView>
</LinearLayout>
styles.xml
<style name="UsefulLinksTextStyling" parent="@android:style/TextAppearance.Medium">
<item name="android:textColor">@color/white</item>
<item name="android:textSize">@dimen/fifteen_size</item>
<item name="android:paddingTop">15dp</item>
<item name="android:paddingLeft">15dp</item>
<item name="android:paddingRight">15dp</item>
</style>
UsefulLinks.java
TextView usefulLinksIntroTextView = (TextView) findViewById(R.id.useful_links);
usefulLinksIntroTextView.setText(Html.fromHtml(data.getUsefulLinks()));
usefulLinksIntroTextView.setMovementMethod(LinkMovementMethod.getInstance());
确保您在textview中设置的html内部没有空格
将您的基本LinearLayout
更改为wrap_content
以便如果html占用的屏幕高度低于屏幕高度,则您没有“额外填充”
您还可以为您的应用程序启用“show layout bounds”,这样您就可以了解哪个View为您提供了“额外填充” http://tysmith.me/post/27035355999/layoutbounds将它与Hierarchy Viewer http结合起来: //developer.android.com/tools/performance/hierarchy-viewer/index.html找出View 出错的地方
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.