我在我的应用程序中需要一个Sliding up Panel,并且发现了这个GitHub
来自Umando App的免费源代码.GitHub滑下Paned Umano
但是因为我是Android的新手,特别是如何使用GitHub
源代码,我不知道如何在我的应用程序中包含这个库或代码.
有没有人体验过这个滑动面板?或者任何人都可以解释我如何包含它?
首先,您必须将库项目下载到您的系统中.下载库项目后如果要在项目中使用该控件,则必须在项目中添加该库项目.
添加库项目您的工作区中有导入库项目.导入后,您需要将其作为库添加到项目中.
要在项目中将项目添加为库,请右键单击项目"转到属性">从左侧选择Android选项卡,然后在api级别下方右侧检查,您将获得选项添加..>单击添加..并将显示列表库项目的选择和从中选择您的库项目>应用.
有关详细信息,请查看以下屏幕截图.
要使用布局,只需com.sothree.slidinguppaneldemo.SlidingUpPanelLayout
在活动布局中包含Root元素即可.确保它有两个孩子.第一个孩子是你的主要布局.第二个孩子是您向上滑动面板的布局.两个孩子都应该设置宽度和高度match_parent
.
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="Main Content"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|top"
android:text="The Awesome Sliding Up Panel"
android:textSize="16sp" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3766 次 |
最近记录: |