2017-08-16 118 views
0

当我创建了一个自定义标题为我使用的RelativeLayout创建一个动态可扩展的布局和扩展

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/header" 
android:layout_width="match_parent" 
android:layout_height="60dp" 
android:background="@drawable/header_bg"> 

<RelativeLayout 
    android:layout_width="30dp" 
    android:layout_height="30dp" 
    android:layout_alignParentEnd="true" 
    android:layout_centerVertical="true" 
    android:layout_marginEnd="25dp"> 

    <ImageButton 
     android:id="@+id/header_overflow" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@drawable/header_overflow" /> 
</RelativeLayout> 
</RelativeLayout> 

Android应用我想有它扩大,并成为填充按钮上时,扩展部分添加按钮上面的ImageButton被按下。正是这样:示

enter image description here

enter image description here

:单击按钮之前和之后(在原来的程序,我试图复制)。忽略涂鸦,因为它不是我的屏幕截图

这是可能的Android?如果是这样,我该怎么做呢?

回答

1

你可以尝试实现这个库,按照这个link here它是免费使用,还可以在GitHub上

+0

谢谢!我甚至搜索了“Android展开式布局”,但没有发现任何东西 – TheDiamondYT

+2

如果您觉得这有帮助,请随时投票并将其选为正确答案 –