想动态的改变textview控件的显示位置找了好久找到了如下接口
TextView.layout(l, t, r, b) 方发  但是更改后并没有效果(更改后使用了invalidate()方法和postInvalidate()方法,但是依然没有效果)请大家帮忙看看,谢谢

解决方案 »

  1.   

    你要对textview所在的parentview进行invalidate
      

  2.   

    试过了,还是不行,原码如下,请在帮忙看看,谢谢
    Xml:
        <FrameLayout android:id="@+id/page_positionl"
                     android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="200px"
                  android:background="@color/black"
                  >
        <TextView android:id="@+id/page_position"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:visibility="gone"
                  android:text="chapter_name"
                  android:textSize="@dimen/port_bookreader_toptar_fontsize"
                  >
        </TextView>  
        </FrameLayout>.java
    mPagePosition = (TextView)findViewById(R.id.page_position);
    page_positionl =(FrameLayout)findViewById(R.id.page_positionl);
    mPagePosition.layout(mPagePosition.getLeft() + 100,mPagePosition.getTop(), mPagePosition.getWidth(),mPagePosition.getHeight());
    mPagePositionl.invalidate();
      

  3.   

    可以用new 一个 AbsoluteLayout.LayoutParams设定位置和大小,然后再用 setLayoutParams函数来设定
    http://blog.csdn.net/saint_bxg/archive/2010/05/19/5607903.aspx
      

  4.   

    项目中使用到的,无下划线效果。Android使用TextView实现无下划线超链接