Switchen von Views

  • Antworten:2
mcfly
  • Forum-Beiträge: 286

29.08.2010, 12:32:07 via Website

Hallo zusammen

Ich würde gerne in einem Layout mit mehreren Views zwischen einer bestimmten TextView auf eine CustomizedView hin und zurück wechseln während der Laufzeit.

Ich habe schon versuche gemacht mit folgendem, was nicht klappt und wahrscheinlich auch nicht der richtige Weg ist :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/main" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
>
<TextView android:id="@+id/mytext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#ffffff"

android:text="" />
</LinearLayout>

super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MyDrawableView mCustomDrawableView;
mCustomDrawableView = new MyDrawableView(this);
tv = (TextView) findViewById(R.id.mytext);
((LinearLayout)findViewById(R.id.main)).removeView(tv);
((LinearLayout)findViewById(R.id.main)).addView(mCustomDrawableView);
....
....


Hat jemand Erfahrung / ein Tipp für mich ?

Grüsse

Antworten
Markus Gu
  • Forum-Beiträge: 2.644

29.08.2010, 12:57:16 via App

nimm einen viewswitcher

swordiApps Blog - Website

Antworten
mcfly
  • Forum-Beiträge: 286

29.08.2010, 13:14:03 via App

danke für die schnelle antwort . das tönt interessant. vielen dank.

Antworten