Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4274250
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:49:18+00:00 2026-05-21T07:49:18+00:00

I have a TableRow with a TextView . Here is the xml for it.

  • 0

I have a TableRow with a TextView. Here is the xml for it.

<TableRow
    android:layout_height="fill_parent" 
    android:layout_gravity="bottom"
    android:layout_width="fill_parent"
    android:background="#BF000000">

    <TextView
        android:id="@+id/topText"
        android:layout_height="wrap_content"
        android:textColor="#FFFFFF"
        android:textSize="19sp"
        android:background="#BF000000"
        android:layout_gravity="center_horizontal"
        android:text="@string/text_searchword"
        android:layout_width="fill_parent">
    </TextView>

</TableRow>

I want to make the table row invisible with fadeout effect on a button touch and vice versa. How can I do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:49:19+00:00Added an answer on May 21, 2026 at 7:49 am

    Any View (TableRow included) can have a fade animation attached to it, but you’ll need to be able to reference your view in code, so the row will need an id:

    <TableRow
      android:id="@+id/my_row"
      android:layout_height="fill_parent" 
      android:layout_gravity="bottom"
      android:layout_width="fill_parent"
      android:background="#BF000000">
      <TextView
        android:id="@+id/topText"
        android:layout_height="wrap_content"
        android:textColor="#FFFFFF"
        android:textSize="19sp"
        android:background="#BF000000"
        android:layout_gravity="center_horizontal"
        android:text="@string/text_searchword"
        android:layout_width="fill_parent">
      </TextView>
    </TableRow>
    

    Now you can reference the row itself in your Java code somewhere (like onCreate() perhaps) as

    View row = findViewById(R.id.my_row);
    

    Notice I don’t cast it as a TableRow. You could if you need to do other things with it, but for just setting visibility leaving it as a View is fine. Then just construct a button click method like this:

    public void onClick(View v) {
        View row = findViewById(R.id.myrow);
        if(row.getVisibility() == View.VISIBLE) {
            row.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_out));
            row.setVisibility(View.INVISIBLE);
        } else {
            row.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_in));
            row.setVisibility(View.VISIBLE);
        }
    }
    

    Fade in and Fade out are standard animations defined in the Android package, you don’t need to create them yourself, just load them using AnimationUtils.loadAnimation(). In this example, the clicking the same button just toggles between fade in and fade out depending on whether or not the View is already visible.

    Hope that Helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have created following layout. <TableLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=horizontal > <TableRow> <TextView android:layout_width=fill_parent android:layout_height=wrap_content
i have a basic information form with textfield, radiofield, and numberfield <TableRow android:id=@+id/tableRow1 android:layout_width=wrap_content
I can use android:gravity=bottom|center_horizontal in xml on a textview to get my desired results,
In my XML, I have a TableLayout with only 1 TableRow i.e. the heading.
I have the following layout for a dialog: <?xml version=1.0 encoding=utf-8?> <TableLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/categorylist
Context: I have a TableLayout (created using XML), which has one TableRow, which has
I have a problem with a textview in android. I made programatically a tablelayout,
I have a tablerow in which i put in a textview with width==50dp ;But
I am trying to implement a android app. I have problems with TextView in
I have an issue with the Android layout. I have some components (here a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.