【问题标题】:what it is called placing an button/image button on border of layout所谓在布局的边框上放置一个按钮/图像按钮
【发布时间】:2016-07-16 20:19:53
【问题描述】:

有谁知道将捕获按钮放置在该布局的边框上是什么意思

【问题讨论】:

  • 很不清楚你在问什么。而且您应该先尝试自己编写代码...
  • @Vucko 你能在我编辑后再次看到我的问题吗
  • 父布局被称为FrameLayout或RelativeLayout

标签: android xml android-layout android-studio imagebutton


【解决方案1】:

例如,您可以创建一个 FrameLayout,其中将包含(除其他外)位于屏幕截图底部的布局和底部边距等于该布局高度一半的按钮。比如:

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Many other sub-layouts -->

    <FrameLayout
        android:id="@+id/bottom_layout"
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:gravity="bottom">
        <!-- bottom bar icons. you can use not Frame but every layout. -->
    </FrameLayout>

    <!-- you can use any widget. Not necessary Button -->
    <Button
        android:id="@+id/photo_button"
        android:layout_width="56dp"
        android:layout_height="56dp"
        android:gravity="bottom"
        android:layout_marginBottom="28dp"/>

</FrameLayout>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-09-02
    • 2016-07-25
    • 1970-01-01
    • 1970-01-01
    • 2016-06-24
    • 2021-07-28
    相关资源
    最近更新 更多