I am having a RelativeLayout with two TextView objects. I want @+id/b to move up if @+id/a is missing.
I therefore tried to set the content null when I inflate the parent view but all what happens is that there is just no text displayed. @+id/b remains on its place and @+id/a is still there - without text.
public View getView(int position, View convertView, ViewGroup parent) {
// ...
holder.a.setText(null);
// ...
}
I've also tried to remove with parent.removeView(holder.a) resulting in a first class app-crash.
Where did I go wrong?
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:id="@+id/a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"/>
<TextView
android:id="@+id/b"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_alignWithParentIfMissing="true"
android:layout_below="@+id/a"
android:layout_alignParentBottom="@+id/a"/>
</RelativeLayout>
0 comments:
Post a Comment