【发布时间】:2012-08-02 02:53:30
【问题描述】:
我是 android 新手,我在这个链接 http://code.google.com/p/android-page-curl/ 中发现了这个很棒的 android 页面卷曲。 我的问题是,如何添加 TextView? 我已经尝试过了,但是当我尝试时它总是强制关闭。 这是我在布局 xml 中的代码。
<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 textview android-relativelayout page-curl