Tag: 布局

增加y轴上文本和标题之间的距离

Y轴标题看起来离轴文本太近了。 ggplot(mpg, aes(cty, hwy)) + geom_point() 我曾尝试更改theme()的许多参数的值,但似乎没有帮助。

是否有可能使用Bootstrap创build一个pinterest般的布局?

我正试图让我的头在这个相当长一段时间现在: 只有Twitter Bootstrap才能创build一个精简的布局? 我知道有像砌体这样的jQuery插件,但没有它们,没有办法吗? 谢谢

Android:SlidingDrawer的高度可以用wrap_content来设置吗?

我试图实现一个SlidingDrawer将占据整个屏幕宽度,但其高度是由其内容dynamic确定的:换句话说,宽度的标准fill_parent布局行为和高度的wrap_content 。 这正是我在布局XML中指定的方式(见下文),但滑动抽屉总是打开到全屏高度。 我的内容高度各不相同,但通常只有屏幕高度的一半左右,所以我最终在它下面留下了很大的空隙。 我想要的内容是整齐地坐在屏幕的底部。 我已经尝试了所有我能想到的方法来解决这个问题,但目前为止还没有成功。 如果我将SlidingDrawer的layout_height为一个特定的值(例如160dip ),它就可以工作,但这不是我所需要的:它必须是dynamic的。 当然,我已经确定所有的子元素的高度都设置为wrap_content 。 关于SlidingDrawer的文档有点含糊不清,而且我还没有find任何可以做我之后做的事情的例子。 如果有人能看到我要去哪里,我真的很感激你的帮助! <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <ViewFlipper android:id="@+id/ImageFlipper" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/imageView0" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scaleType="centerCrop" /> <ImageView android:id="@+id/imageView1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scaleType="centerCrop" /> <ImageView android:id="@+id/imageView2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scaleType="centerCrop" /> </ViewFlipper> <SlidingDrawer android:id="@+id/infoDrawer" android:layout_width="fill_parent" android:layout_height="wrap_content" android:handle="@+id/infoDrawerHandle" android:content="@+id/infoDrawerContent" android:allowSingleTap="false" android:layout_alignParentBottom="true" android:orientation="vertical" > <!– Sliding drawer handle –> […]

从Java代码中指定DIP尺寸的正确方法是什么?

我发现可以使用DIP在XML布局中设置我的界面元素的尺寸,如以下片段所示: android:layout_width="10dip" 但是所有的Java接口都将整数作为参数,并且没有办法在DIP中指定维度。 什么是正确的方法来计算这个? 我想我必须使用DisplayMetrics类的属性密度,但这是一个正确的方法吗? 我可以依靠这个公式总是正确的吗? 像素* DisplayMetrics.density = dip 在Android的某个地方是否有一个实用的function?

graphics自动布局algorithm

为了简化问题,我有一个包含在2D平面上的节点和边的图。 我想要做的是点击一个button,它会自动布局图看起来干净。 通过这个,我意味着最小的边缘交叉,节点之间的漂亮的空间,甚至可以表示graphics比例(加权的边缘)。 我知道这完全是一个干净的图表的主观,但是有没有人知道一个algorithm开始,而不是重新发明轮子? 谢谢。

Android – 如何将视图置于屏幕外?

我试图在我的应用程序中创build一个简单的ImageViewanimation,并且我希望它从屏幕底部滑入,并进入静止位置,顶部50px的视图离开屏幕的顶部(例如最终位置的ImageView应该在-50px在X)。 我试图使用AbsoluteLayout来做到这一点,但是这实际上切断了ImageView的顶部50px,使得顶部的50px永远不会被渲染。 我需要让ImageView的顶部50像素可见/呈现animation,然后稍微离开屏幕稍微rest一下。 我希望我已经解释得很好。 这是我目前使用的布局和幻灯片animation(目前不会呈现ImageView的顶部50px): 布局: <?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/QuickPlayClipLayout"> <ImageView android:id="@+id/Clip" android:background="@drawable/clip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_y="-50dp"> </ImageView> </AbsoluteLayout> animation: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromYDelta="100%p" android:toYDelta="0" android:duration="1000"/> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="1000" /> </set> 提前致谢。

UIScrollView和约束

我想把UIImageView放在UIScrollView的顶部,当我将UIScrollView约束到View Controller的两边,并将UIImageView约束到顶部,并使UIImageView的宽度等于UIScrollView时,它使UIImageView的方式比UIScrollView更宽,比想象的要高得多。 任何想法我做错了什么? 故事板: 预习:

如何创buildEditText只接受在Android的字母表?

如何才能在Android中的EditText中只input字母表?

你如何setLayoutParams()的ImageView?

我想设置一个ImageView的LayoutParams ,但似乎找不到正确的方法来做到这一点。 我只能在各种ViewGroups的API中find文档,而不是ImageView 。 然而ImageView似乎有这个function。 此代码不起作用… myImageView.setLayoutParams(new ImageView.LayoutParams(30,30)); 我该怎么做?

如何强制整个布局查看刷新?

我想要强制主要的布局资源视图重绘/刷新,说Activity.onResume()方法。 我该怎么做? 通过主布局视图,我的意思是在我的Activity.onCreate()中调用的一个(下面的“R.layout.mainscreen”),如下所示: – protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mainscreen); }