首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >按钮不适合屏幕-如何缩小布局的其余部分

问按钮不适合屏幕-如何缩小布局的其余部分
EN

Stack Overflow用户
提问于 2014-05-14 15:54:33
回答 2查看 347关注 0票数 0

我对日历的布局有问题-“完成”按钮不完全可见

​

​

我相信这个布局的源码是:https://android.googlesource.com/platform/packages/apps/Calendar/+/d1db03631de67104f7d3b3da73eaeec28a80aef2/res/layout/recurrencepicker.xml

有什么想法应该怎么解决吗?我可能会将显示月份日期的区域缩小一点,但老实说,我找不到它们的布局……我知道有两个月的视图-一个显示五月,另一个显示六月的一部分。我可能会缩小甚至删除六月份的部分,但是它在哪里呢?

EN

回答 2

Stack Overflow用户

发布于 2014-05-14 16:08:32

尝试减少marginTop,将其设置为android:layout_marginTop="4dp",从

代码语言:javascript
复制
<com.android.calendar.recurrencepicker.LinearLayoutWithMaxWidth
                    android:id="@+id/weekGroup"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="4dp"
                    android:layout_marginRight="4dp"
                    android:layout_marginTop="8dp"
                    android:gravity="center_horizontal"
                    android:orientation="horizontal" >

在那里是8dp。希望它能在视图中做出一些改变。

票数 0
EN

Stack Overflow用户

发布于 2014-05-14 16:32:45

我假设日历和按钮在相同的布局中,如果不是,但它们在一个布局中,并将其设置为height match_parent,然后给它一个weight_sum为1,并为日历0.9分配0dp height,为按钮分配0.1 weight和0dp height:

代码语言:javascript
复制
        <LinearLayout 
                    android:id="@+id/container_layout"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:background="@android:color/transparent"
                    android:orientation="vertical"
                    android:weightSum="1">

                <LinearLayout 
                    android:id="@+id/calendar"
                    android:layout_width="wrap_content"
                    android:layout_height="0dp"
                    android:layout_weight="0.9">

                  <!--  calender layout contents  -->  

                </LinearLayout>

                <Button
                   android:id="@+id/done_button"
                   android:layout_width="wrap_content"
                   android:layout_height="0dp"
                   android:layout_weight="0.1" />

        </LinearLayout>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23648696

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档