2016-01-08 38 views
3

我有一个活动,即使我没有应用底部填充,也会在底部显示额外空间。样式代码,XML代码,Java代码和截图低于和有关JSON数据是在这里:Android:填充0dp时底部显示额外空间的活动 - 与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()); 

Screenshot

+1

尝试改变滚动型高度匹配父母 – Mahalakshmi

+0

没有什么不同,但是谢谢 –

+0

尝试使用uiautomatorview工具,它是lo在sdk/tools /文件夹中。它可能会让你知道填充是哪个项目的一部分 – Jahnold

回答

1

确保您设置搜索的HTML克至TextView的不让它

改变你的基地LinearLayoutwrap_content内空白,这样如果HTML占用不到屏幕高度,你不必“微胖”

你也可以打开“显示布局界限”为您的应用程序,这样,你就会明白其中的观点是给你的“微胖” http://tysmith.me/post/27035355999/layoutbounds与层次浏览器http://developer.android.com/tools/performance/hierarchy-viewer/index.html结合起来制定出的图,是有过错

相关问题