UI Problem

AleksandrAlekseevAleksandrAlekseev ✭✭RUMember ✭✭
edited March 2016 in Xamarin.Android

Hi all!
There is a problem in UI when setting dynamic text field size from 1 to 3 lines. The text comes from the server
When activity is loaded, when scrolling occurs the empty space which does not disappear.
If click to run:

var card = FindViewById(Resource.Id.taskCard);

card.Visibility = ViewStates.Gone;
card.Visibility = ViewStates.Visible;

That empty space disappears.

But I would like to understand the problem and receive a competent solution

Pic 1 CardView contains TextView with dynamic text
Pic 2 UI Problem - free space

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />

<android.support.v7.widget.CardView
app:layout_scrollFlags="scroll|enterAlways"
android:layout_width="match_parent"
android:layout_height="80dp"
app:cardUseCompatPadding="true"
app:cardElevation="3dp"
android:layout_marginBottom="3dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
app:contentPadding="8dp"
android:id="@+id/textCard">;

</android.support.v7.widget.CardView>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.DrawerLayout>

<?xml version="1.0" encoding="utf-8"?>

<android.support.v7.widget.CardView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
card_view:cardUseCompatPadding="true"
card_view:cardElevation="3dp"
android:layout_marginBottom="3dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:id="@+id/taskCard">;
















</android.support.v7.widget.CardView>

1.jpg 266.3K
2.jpg 213.1K

Answers

  • AleksandrAlekseevAleksandrAlekseev ✭✭ RUMember ✭✭
    edited April 2016

    Problem solve, update to last version "Support Material Design Library" and other support

Sign In or Register to comment.