开发者

How Can I add text on the top of image like pulse in android

I want to recreate pulse like UI for one of my android app. I want to know How can I put transparent text over an image like pulse also how can I create 2nd screen like pulse where we read the stories. In this screen How this bottom selecting elements comes and hide automatically and when clicked is it the complete activity being changed or only the text changes?.

Find below the two UI which I am mentioning about

How Can I add text on the top of image like pulse in android

How this bottom navigation is hiding?

How Can I add text on the top of image like pulse in android

开发者_JAVA技巧

Thanks pranay


User RelativeLayout. Here is an example which places a TextView on Top of an ImageView and centers the text on the image.

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <ImageView
        android:layout_width="wrap_content"
        android:id="@+id/MyImage"
        android:adjustViewBounds="true"
        android:layout_height="wrap_content"/>
    <TextView
        android:id="@+id/TextOnImage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true"/>
</RelativeLayout>


A relativeLayout will solve your problem, because it allows you to define the position of every child element independantly from each other. Just use margin and paddings to adjust the exact layout you want.


You should use Relative layout

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜