我正在尝试为工具提示创建一个纯CSS三角形.除了最新的Firefox 4之外,所有浏览器看起来都很好.这是代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Untitled Document</title>
<style>
.arrow {
border:50px solid;
border-color:#eee transparent transparent transparent;
display:block;
height:0;
width:0;
top:50%;
right:50%;
position:absolute;
}
</style>
</head>
<body>
<div style="border:1px solid #000; height:400px; width:400px; margin:50px auto; position:relative;">
<span class="arrow"></span>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
Firefox 4截图:

其他浏览器截图:

正如你在Firefox 4中看到的那样,它有类似边框的东西.它是一个Firefox bug还是这个行为?
如何在FF4中实现没有可见边框的纯CSS三角形?此外,我需要其他3种颜色是透明的,因为这个三角形将重叠一些元素.
我想在我的UIViewController中添加一个UIView,但我希望它是透明的,直到我决定在UIView中创建一个Oval.
在我创建椭圆之前,我可以将视图的alpha设置为0但是当我想添加椭圆时,背景颜色仍然是黑色.
这是一堆椭圆形的样子

在我的UIView中:
- (void)drawRect:(CGRect)rect
{
[self pushContext];
UIBezierPath *oval = [UIBezierPath bezierPathWithOvalInRect:self.bounds];
[[UIColor redColor] setFill];
[oval fill];
self.opaque = NO;
[self setBackgroundColor:[UIColor clearColor]];
[oval addClip];
[self setBackgroundColor:[UIColor clearColor]];
[self popContext];
}
Run Code Online (Sandbox Code Playgroud) 我想实现以下布局:
我列举了一个如何看待它的例子.
我在Cheesesquare上关注了CollapsingToolbarLayout和AppBarLayout实现的这个很好的例子 .我设法让内容使用CollapsingToolbarLayout内的地图(在布局xml中注释掉),但这不是理想的结果.
但是我没有找到任何解决方案/文档来使灰色框(见中间的内部图像)在初始位置是透明的.我希望它是透明的,以便看到地图.当用户向上滚动时,CollapsingToolbarLaoyut应该正常工作并折叠透明窗口并显示工具栏.现在,图像看起来只是白色或我给它的任何颜色.我已经尝试将颜色设置为透明,但它没有达到预期的效果.
所以我的问题是:如何在初始阶段将"CollapsingToolbarLayout"设置为透明(参见图像第1层灰框)?
这是我的布局代码.CollapsingToolbarLayout效果很好,但我看不到下面的地图.如果有可能实施将会很棒.
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<!-- Layer 0 -->
<FrameLayout
android:id="@+id/overlayFragmentMap"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="0dip"
/>
<!-- Layer 1 -->
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="192dp"
android:fitsSystemWindows="true"
android:theme="@style/CustomActionBar">
<!--android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar-->
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorAccent"
app:expandedTitleMarginBottom="32dp"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:expandedTitleTextAppearance="@color/black"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<!-- Map view inside here works perfectly but is not
the deisired result -->
<!--
<FrameLayout
android:id="@+id/overlayFragmentMap"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="0dip"
app:layout_collapseMode="parallax"
/>
-->
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/transparent" …Run Code Online (Sandbox Code Playgroud) android transparent android-layout android-collapsingtoolbarlayout
我有以下布局:

我想透明透明的transparent_layout,但我不能这样做.
已经尝试使用颜色以编程方式设置背景:Color.TRANSPARENT但似乎它不起作用.
我使用Android 2.3.3 SDK与SherlockActionBar.
有没有办法将该布局设置为透明?
我将签名图像保存为.jpg图片.我使用graphic2d在图像上绘制每个像素的签名(用签名平板电脑获得)并且它完美地工作但我总是得到白色背景.如果我想将签名放在PDF文档上,jpg图像的白色方块的边框覆盖了PDF的一些单词.
我想要的是用透明背景保存jpg图像,所以当我把它放在PDF上时,没有白色图像背景覆盖的文字,只有标记线.
这是保存缓冲图像的代码.它用白色背景做到了.
// This method refers to the signature image to save
private RenderedImage getImage() {
int width = tabletWidth;
int height = tabletHeight;
// Create a buffered image in which to draw
BufferedImage bufferedImage = new BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
// Create a graphics contents on the buffered image
Graphics2D g2d = bufferedImage.createGraphics();
// Draw graphics
g2d.setColor(Color.WHITE);
g2d.fillRect(0, 0, width, height);
drawPoints(Tablet.getPenPoints(), g2d, Color.BLACK);
// Graphics context no longer needed so dispose it
g2d.dispose();
return bufferedImage;
}
Run Code Online (Sandbox Code Playgroud)
我试图将它设置为透明但没有成功,所以我发布了这个工作部分.
我在IOS7中尝试了很多次和UITableView透明的很多方法,但它仍然不起作用.我没有任何想法......
"[cell setBackgroundColor:[UIColor clearColor]];"
UIView* bgv = [[UIView alloc] init];
bgv.backgroundColor = [UIColor clearColor];
[cell setBackgroundColor:[UIColor clearColor]];
[cell setBackgroundView:bgv];
cell.backgroundColor = [UIColor colorWithRed:(247.0/255.0)
green:(151.0/255.0) blue:(121.0/255.0) alpha:.3];
Run Code Online (Sandbox Code Playgroud)
我试过这3种方法,但仍然无效.
有人可以提供一些关于这个问题的提示吗?
非常感谢〜
我选择了这个免费的bootstrap主题,我的问题是我想创建透明面板,但是当我opacity: 0.8;在面板中设置文本时,当然,变得透明,这不是我想要发生的事情.我尝试使用这个CSS代码,但看起来标题和正文后面仍然有一些东西,面板不透明.
.panel-transparent .panel-heading{
background: rgba(122, 130, 136, 0.2)!important;
}
.panel-transparent .panel-body{
background: rgba(46, 51, 56, 0.2)!important;
}
Run Code Online (Sandbox Code Playgroud)
编辑 - 示例HTML:
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Panel primary</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我有一个具有背景的Windows窗体应用程序.在其中,我有一个透明背景的flowlayoutpanel.当我滚动时,会发生以下情况:

我也看到一些闪烁.我已经尝试了所有的双缓冲业务,但它不起作用.
有什么建议?
我有一个UIView,我希望它存储为透明的PNG,即没有UIVIew背景颜色......
我目前正在使用此代码,它工作正常,但背景颜色:(
UIGraphicsBeginImageContext(self.bounds.size);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage* image1 = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData *imageData = UIImagePNGRepresentation(image1);
[imageData writeToFile:filePath atomically:YES];
Run Code Online (Sandbox Code Playgroud)
那么有没有人知道如何将这个图像作为一个透明的图像?
先感谢您..
transparent ×10
android ×2
css ×2
ios ×2
uiview ×2
android-collapsingtoolbarlayout ×1
background ×1
c# ×1
firefox4 ×1
flicker ×1
gnuplot ×1
graphics ×1
iphone ×1
java ×1
objective-c ×1
opacity ×1
png ×1
point ×1
scatter ×1
screen ×1
scroll ×1
uitableview ×1