0

I have added my Views to the RelativeLayout

 <RelativeLayout    ----------------->views added to this layout

  </RelativeLayout>

</ScrollView>

inflated xml:

    <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"

    tools:context=".MainActivity" >



    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/iv_background"
        android:src="@drawable/new_bg"

         />

    <TextView 
         android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/tv_title"
        android:text="Hello"
        />

</RelativeLayout>

Added Views like below:

final View view= getActivity().getLayoutInflater().inflate(R.layout.inflated, null);
    iv1=(ImageView)view.findViewById(R.id.iv_background);
        tvTitle=(TextView)view.findViewById(R.id.tv_title);

        rl_flower.addView(view);

I want to change this Textview color dynamically while scrolling.

I mean in

  onScrollChanged()
{

----------------------------------->  I want to change my Textview color
}

I tried to change,but didnt not reflect. I want to know whether it is possible to change textcolor after adding views to my layout.

Please suggest.

user1891910
  • 843
  • 2
  • 16
  • 44

0 Answers0