i want make fixed footer, but I've got a problem.
My activity_main:
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.shppandroid1.app.MainActivity">
<ListView
android:id="#+id/listView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ececec"
android:divider="#null"
android:dividerHeight="0dp"/>
</android.support.v4.widget.SwipeRefreshLayout>
If I add here LinearLayout, the app just shows the error. How can I make fixed footer?
Example: http://blog.maxaller.name/wp-content/uploads/2010/05/listview_footer_scrolling.png -> Button "Add Item" - it fixed footer.
Finally i got it.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:id="#+id/footer"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="#0A756E"
android:gravity="center" >
<LinearLayout
android:id="#+id/ll_archiv"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/tv_archiv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:text="#string/archiv"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#fff" />
</LinearLayout>
</RelativeLayout>
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:id="#android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#id/footer"
android:layout_alignParentTop="true" >
</ListView>
</android.support.v4.widget.SwipeRefreshLayout>
Inside of your code, u have to set the height of the footer as a padding for the listview. Because this is in px and u'll need dp, just transform it:
float scale = getResources().getDisplayMetrics().density;
int size = (int) (FOOTERHEIGHT * scale + 0.5f);
SWIPEREFRESHLAYOUT.setPadding(0, 0, 0, size);
Related
The main problem here is that the parent layout is nested scroll view so the height must be wrap content
so the view is like first image
what I want is to make the "don't have an account? register" TextView
to be at the bottom of the screen so I calculate the height of my
phone then the height of layout to subtract to subtract them and
assign the result to the top margin of textview
and here's my code
ViewTreeObserver observer = binding.parentConstraint.getViewTreeObserver();
if (observer.isAlive()) {
observer.addOnGlobalLayoutListener(() -> {
DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
float parentViewHeightInDP = (int) (binding.parentConstraint.getHeight() / displayMetrics.density);
if (getContext() != null) {
float heightInDP = displayMetrics.heightPixels / displayMetrics.density;
float distanceBetweenLayoutBottomAndParenBottom = heightInDP - parentViewHeightInDP;
if (distanceBetweenLayoutBottomAndParenBottom > 32) {
if (topMargin == 0) {
topMargin = 1;
ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) binding.loginTextDontHaveAccount.getLayoutParams();
layoutParams.topMargin = Math.round(distanceBetweenLayoutBottomAndParenBottom);
Handler handler = new Handler();
handler.postDelayed(() -> {
binding.loginTextDontHaveAccount.requestLayout(); },
50);
}
}
but that the result I got
so my real question here is why there still some space here, I mean
the TextView should be exactly at the bottom
What I would suggest you to make NestedScrollView as a child instead of parent.
Make RelativeLayout as your parent and use layout_alignParentBottom to set TextView at bottom. Something like this.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:colorBackground"
android:clickable="true"
android:fillViewport="true"
android:focusable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="#+id/img1"
android:layout_width="wrap_content"
android:layout_height="650dp"
android:background="#mipmap/ic_launcher" />
<ImageView
android:layout_width="match_parent"
android:layout_height="650dp"
android:layout_below="#+id/img1"
android:background="#color/colorPrimary" />
</LinearLayout>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
</RelativeLayout>
Try this:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<AutoCompleteTextView
android:id="#+id/emailtext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:hint="Email"
android:inputType="textEmailAddress"
android:textColorHint="#80000000" />
<EditText
android:id="#+id/passwordtext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:hint="Password"
android:inputType="textPassword"
android:textColorHint="#80000000" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center">
<Button
android:id="#+id/enter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Enter"
android:textAllCaps="false"
app:layout_constraintBottom_toTopOf="#id/textView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="This is my app"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/enter" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
You can use constraint layout. Pay attention to layout_constraintBottom_toTopOf button and layout_constraintTop_toBottomOf textview.
I have an ImageView inside a CollapsingToolbarLayout and the ImageView takes up the whole screen with some info at the bottom. When user clicks on the ImageView i'd like the height of the CollapsingToolBarLayout to become 150dp. How do I set the height of the CollapsingToolBarLayout to have a smooth animation to be set to height of 150dp. I'd like the height to smoothly and slowly get to 150dp not quick, to have a nice animation.
How can i achieve this?
activity_scrolling.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.myapplication.foodapp.ScrollingActivity"
android:id="#+id/coordinator_layout"
android:animateLayoutChanges="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.PopupOverlay"
android:animateLayoutChanges="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_tool_bar_layout"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:animateLayoutChanges="true">
<ImageView
android:id="#+id/chipotle_image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_gravity="fill_vertical"
android:src="#mipmap/food1"
android:adjustViewBounds="true"
android:scaleType="fitXY"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Chipotle Chicken Fajitas"
android:textSize="27sp"
android:layout_gravity="bottom"
android:layout_marginBottom="40dp"
android:layout_marginLeft="5dp"
android:textColor="#fff"
android:id="#+id/first_food_title"/>
<me.grantland.widget.AutofitTextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="16 ingredients | 284 Calories | 1 hour"
android:singleLine="true"
android:textAlignment="center"
android:textColor="#fff"
android:layout_gravity="bottom"
android:textSize="20sp"
android:id="#+id/spec_text"/>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="150dp"
app:layout_collapseMode="pin"
android:animateLayoutChanges="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="#mipmap/arrow"
android:id="#id/back_Arrow"
android:layout_marginTop="5dp"
/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<!-- ** CONTENT SCROLLING LAYOUT ** -->
<include layout="#layout/content_scrolling">
</include>
</android.support.design.widget.CoordinatorLayout>
You can achieve this with ValueAnimator.
ValueAnimator anim = ValueAnimator.ofInt(viewToIncreaseHeight.getMeasuredHeight(), finalValue);
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
#Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
int val = (Integer) valueAnimator.getAnimatedValue();
ViewGroup.LayoutParams layoutParams = viewGroup.getLayoutParams();
layoutParams.height = val;
viewGroup.setLayoutParams(layoutParams);
}
});
anim.start();
i'm in serious problem. I'm trying to get EditText from tab1 in Tabhost, but it keeps giving me error:
Attempt to invoke virtual method 'android.view.View android.widget.LinearLayout.findViewById(int)' on a null object reference.
I have tried my code in many many different ways without any success!
Here is my Code :
final LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View control_layout = inflater.inflate(R.layout.control_layout,null,false);
TabHost tbhst = (TabHost)control_layout.findViewById(R.id.tabHost);
tbhst.setup();
TabHost.TabSpec tb1 = tbhst.newTabSpec("TAB 1");
TabHost.TabSpec tb2 = tbhst.newTabSpec("TAB 2");
TabHost.TabSpec tb3 = tbhst.newTabSpec("TAB 3");
tb1.setContent(R.id.tab1);
tb2.setContent(R.id.tab2);
tb3.setContent(R.id.tab3);
tb1.setIndicator("CMD");tb2.setIndicator("Chat");tb3.setIndicator("Control");tbhst.addTab(tb3);tbhst.addTab(tb2);tbhst.addTab(tb1);
LinearLayout gff = (LinearLayout)tbhst.findViewById(R.id.ggf);
FrameLayout tbs_content = (FrameLayout)gff.findViewById(android.R.id.tabcontent);
LinearLayout tbs1 = (LinearLayout)tbs_content.findViewById(R.id.tab1);
final EditText command_resualt_box = (EditText) tbs1.findViewById(R.id.editText5);
UPDATE :
as #popvitsj said maybe i'm making mistake but i tried to change it in layout/control.xml, but it gives me another different error and here is a Screenshot :
and this the code in layout/control.xml :
<?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"
android:id="#+id/control_q">
<TabHost
android:layout_width="fill_parent"
android:layout_height="410dp"
android:id="#+id/tabHost"
android:layout_gravity="center_horizontal">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="#+id/ggf">
<TabWidget
android:id="#android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"></TabWidget>
<FrameLayout
android:id="#+id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="#+id/tab1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/linearLayout"
android:layout_gravity="center_horizontal">
<EditText
android:layout_width="match_parent"
android:layout_height="35dp"
android:id="#+id/editText9"
android:inputType="text"
android:imeOptions="actionDone"
android:background="#android:color/black"
android:textColor="#ffff0c00"
android:layout_marginTop="5dp" />
<EditText
android:layout_width="match_parent"
android:layout_height="300dp"
android:inputType="textMultiLine"
android:ems="10"
android:id="#+id/editText10"
android:enabled="false"
android:background="#android:color/black"
android:textColor="#ffff0c00"
android:autoLink="all"
android:layout_marginTop="5dp"
android:scrollbars="horizontal|vertical"
android:linksClickable="true"
android:editable="false" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/tab2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:id="#+id/linearLayout2" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" >
<EditText
android:layout_width="260dp"
android:layout_height="40dp"
android:id="#+id/editText11"
android:background="#android:color/black"
android:textColor="#ffff0c00"
android:layout_marginLeft="5dp"
android:layout_marginTop="2.5dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/button11"
android:id="#+id/button12"
android:background="#android:color/black"
android:textColor="#ffff0c00"
android:layout_marginLeft="5dp" />
</LinearLayout>
<EditText
android:layout_width="match_parent"
android:layout_height="300dp"
android:enabled="false"
android:inputType="textMultiLine"
android:background="#android:color/black"
android:textColor="#ffff0c00"
android:autoLink="all"
android:ems="10"
android:id="#+id/editText12"
android:layout_gravity="center_horizontal"
android:layout_weight="0.53"
android:layout_marginTop="5dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/tab3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"></LinearLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
</LinearLayout>
NOTE : this code is giving an error you can take look on screenshot above.
FrameLayout tbs_content = (FrameLayout)gff.findViewById(android.R.id.tabcontent);
LinearLayout tbs1 = (LinearLayout)tbs_content.findViewById(R.id.tab1);
The second of these lines gives the NullPointerException. So tbs_content is null, because it fails to load it on the first line.
It looks like you made a mistake specifying the id: android.R.id.tabcontent should most likely be R.id.tabcontent.
android.R is the R-class for the system resources. R is usually your own generated class (unless you import android.R).
I would like to make an activity with this structure:
The idea is to put some text in the top, a banner allways in the top, the button OVER the banner and my canvas in the center of the view, using all the possible space.
I'm subclassing View to draw my canvas and overloading the onMeasure() method:
#Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// Calculate the size of the board
this.squareSize = MeasureSpec.getSize(widthMeasureSpec) / BOARD_NUM_ROWS;
this.leftMargin = (MeasureSpec.getSize(widthMeasureSpec) - squareSize*BOARD_NUM_COLUMNS) / 2;
this.topMargin = this.leftMargin;
// Set the size of the board to full width and aspect ratio height
int desiredWidth = MeasureSpec.getSize(widthMeasureSpec);
int desiredHeight = this.topMargin + (BOARD_NUM_ROWS * this.squareSize) + this.topMargin;
this.setMeasuredDimension(desiredWidth, desiredHeight);
}
And this is my XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".DrawLevelActivity"
android:background="#color/activity_background">
<TextView
android:id="#+id/instructionsText"
android:gravity="center"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<com.mycanvas.BoardCanvas
android:id="#+id/boardCanvas"
android:gravity="center"
android:layout_below="#+id/instructionsText"
android:layout_centerVertical="true"
android:padding="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="#+id/solveButton"
android:gravity="center"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:layout_below="#+id/boardCanvas"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<com.google.ads.AdView
xmlns:googleads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="#+id/adView"
android:gravity="center"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
googleads:adSize="BANNER"
googleads:adUnitId="#string/admob_id" />
</RelativeLayout>
Unfortunately the button appear under the banner and I think that the reason is that the canvas is very large.
The set value in onMeasure() is always smaller than MeasureSpec.getSize(heightMeasureSpec)
The key here is to use a LinearLayout setting a layout_weight value just for your canvas. This way, the top and above views will wrap their content, and the canvas will fill the free space. The layout xml would look like this.-
<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" >
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical|center_horizontal"
android:background="#990099"
android:text="Some text here" />
<RelativeLayout
android:id="#+id/canvas"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#999900"
android:layout_weight="1">
<!-- The canvas -->
</RelativeLayout>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
<RelativeLayout
android:id="#+id/banner"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#009999">
<!-- The banner -->
</RelativeLayout>
</LinearLayout>
Notice I set some hardcoded heights and colors so that you can easily see the results. This layout will render a view like this.-
I have a layout wich is nested like this:
<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" >
<ScrollView
android:id="#+id/scrollAplicacoes"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin" >
<TextView
android:id="#+id/titulo"
android:layout_width="match_parent"
android:layout_height="60dp"
android:fontFamily="Arial"
android:lineSpacingExtra="-5dp"
android:text="#string/titulo_aplicacao"
android:textColor="#3c3c3c"
android:textSize="25sp"
android:textStyle="bold"/>
<ImageView
android:id="#+id/btnAplicacaoUm"
android:layout_width="match_parent"
android:layout_height="150dp"
android:onClick="selectAplicacao"
android:src="#drawable/aplicacoes_item1" />
<ImageView
android:id="#+id/btnAplicacaoDois"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginTop="10dp"
android:onClick="selectAplicacao"
android:src="#drawable/aplicacoes_item2" />
<ImageView
android:id="#+id/btnAplicacaoTres"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginTop="10dp"
android:onClick="selectAplicacao"
android:src="#drawable/aplicacoes_item3" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="#+id/menuFixo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#drawable/faixa_below" >
<ImageView
android:id="#+id/belowHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:contentDescription="#string/descBtnHome"
android:layout_marginTop="5dp"
android:src="#drawable/below_home_sel" />
<ImageView
android:id="#+id/belowCalculadora"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="abreCalculadora"
android:contentDescription="#string/descBtnCalculadora"
android:layout_marginTop="5dp"
android:src="#drawable/below_calc" />
<ImageView
android:id="#+id/belowProdutos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/descFaixaProdutos"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:src="#drawable/below_produtos" />
</LinearLayout>
</RelativeLayout>
The problem is that the LinearLayout outside the ScrollView, at the end is fixed on the bottom, and the scroll is placed behind it. So i need the Scroll to be the screen height minus this fixed LinerLayout height minus a little margin.
I tried this:
(...)
int scrollFInalHeight = scrollHeight - fixedMenuHeight - 10;
ViewGroup.LayoutParams param = new ViewGroup.LayoutParams(scrollStartWidth, scrollFInalHeight);
scroll.setLayoutParams(param);
But the app crashes when I start this activity.
This java code is within the public void onWindowFocusChanged(boolean hasFocus) method.
Any suggestions?
Thanks in advance! ;)
You need to set Height
scroll_view.setLayoutParams(new RelativeLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
or
scroll_view.setLayoutParams(new RelativeLayout.LayoutParams(
LayoutParams.FILL_PARENT, 350));
#aNikeT's answer is correct, but it will be safer with
ViewGroup.LayoutParams layoutParams = mDescriptionScrollView.getLayoutParams();
layoutParams.height = scrollViewHeight;
Have you tried to put
android:layout_above="#+id/menuFixo"
in your ScrollView?