我是Android新手,我發現在這個鏈接http://code.google.com/p/android-page-curl/這個偉大的android頁面捲曲。 我的問題是,如何添加TextView? 我試過了,但當我嘗試時它總是強制關閉。 這是我在佈局xml中的代碼。如何在PageCurl中添加TextView?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<cv.tarie.pagecurl.PageCurlView
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:id="@+id/dcgpagecurlPageCurlView1"/>
<LinearLayout android:id="@+id/textlayout"
android:layout_width="fill_parent" android:layout_height="100dp"
android:layout_alignParentBottom="true" android:gravity="center"
android:background="#55000000" android:padding="5dp">
<TextView android:id="@+id/dialog" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:textSize="18dp"
android:textColor="#FFFFFF" />
</LinearLayout>
</RelativeLayout>
我在PageCurlView中添加了這段代碼。
TextView tv = (TextView) findViewById(R.id.dialog);
tv.setText("Hello!");
我的代碼有錯?
謝謝..
好..這是我的錯,因爲我是新的Android ..:D 我只是嘗試使文本透明背景.. :) – Faras 2012-08-02 03:35:52
@ user1561886:那麼,你的問題又是什麼?它甚至與PageCurlView有什麼關係? ;) – Oliver 2012-08-02 03:43:16
嗯..是的,我錯了。我只需要使TextView具有黑色透明背景,並且我希望在頁面翻轉時文本發生變化。在再次提出問題之前,我需要現在做研究。 -.-「 順便說一句,謝謝你回答我的問題。:) – Faras 2012-08-02 04:03:26