Android-如何使用RelativeLayout定位此自定义气球视图
我一直在努力让它发挥作用 看下面的图片,我想把气泡放在图片下面。Android-如何使用RelativeLayout定位此自定义气球视图,android,android-relativelayout,custom-view,Android,Android Relativelayout,Custom View,我一直在努力让它发挥作用 看下面的图片,我想把气泡放在图片下面。 当然,我希望能把风景放在我喜欢的任何地方 我认为问题出在父视图中,因此我将父xml添加到中。 也许我需要将RelativeLayout更改为其他内容, 我试过很多东西,但都不管用 这是我的泡泡xml <?xml version="1.0" encoding="utf-8"?> <FrameLayout android:id="@+id/frameLayout_balloon_gallery_activity
当然,我希望能把风景放在我喜欢的任何地方 我认为问题出在父视图中,因此我将父xml添加到中。
也许我需要将RelativeLayout更改为其他内容,
我试过很多东西,但都不管用 这是我的泡泡xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@+id/frameLayout_balloon_gallery_activity_send"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:id="@+id/imv_balloon_gallery_activity_send"
android:src="@drawable/balloon_gallery"
android:scaleType="fitCenter"
android:layout_height="fill_parent"
android:layout_width="fill_parent"/>
</FrameLayout >
这是我插入气泡的父对象
您需要创建一个包含ImageView和气泡的RelativeLayout。使用“低于位置”属性将气泡放置在ImageView下方。从此处,您可以将RelativeLayout移动到任何位置,气泡将保留在图像下方。查看此处的快速操作是如何实现的。功能与您想要的类似。太好了,当然是您的权利。这是有效的,RelativeLayout只是一个视图对视图的视图,因此我可以移动它。我在搜索过程中看到了该帖子。我想我可以先试试这个,因为它更复杂,代码也更多
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/relativelayout_main_activity_back"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gallery_activity_back"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:spacing="2dip"
android:gravity="top"
android:paddingTop="20dip"
/>
<RelativeLayout
android:id="@+id/relativeLayoutinner_activity_back"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<EditText
android:id="@+id/etx_addtext_activity_back"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="false"
android:text="@string/string_enter_text_here"
/>
</RelativeLayout>
</RelativeLayout>