SVG使用标签和ReactJS(SVG use tag and ReactJS)
所以通常要包括大部分我需要简单样式的SVG图标,我做:
<svg> <use xlink:href="/svg/svg-sprite#my-icon" /> </svg>
现在,我一直在使用ReactJS来评估它作为我的新前端开发堆栈中可能的组件,但是我注意到在支持的标签/属性列表中,不支持
use
或者xlink:href
。是否可以使用svg精灵并以这种方式在ReactJS中加载它们?
So normally to include most of my SVG icons that require simple styling, I do:
<svg> <use xlink:href="/svg/svg-sprite#my-icon" /> </svg>
Now I have been playing with ReactJS as of late evaluating it as a possible component in my new front-end development stack however I noticed that in its list of supported tags/attributes, neither
use
orxlink:href
are supported.Is it possible to use svg sprites and load them in this way in ReactJS?
原文:https://stackoverflow.com/questions/26815738
最满意答案
屏幕上的几乎任何东西都是可点击的(除了那些命中测试为
HTERROR
,HTNOWHERE
和HTTRANSPARENT
)。理智的方法是使用UI Automation / MSAA。 调用
WindowFromPoint
,ChildWindowFromPoint
或RealChildWindowFromPoint
获取HWND,然后调用AccessibleObjectFromWindow
以获取IAccessible
接口并调用accDoDefaultAction
。一个不太理智的选择是使用
WM_NCHITTEST
来确定鼠标结束的内容并发送一些假的WM_NCLBUTTON*
消息。Almost anything on screen is clickable (except things that hit-test as
HTERROR
,HTNOWHERE
andHTTRANSPARENT
).The sane approach is to use UI Automation/MSAA. Call
WindowFromPoint
,ChildWindowFromPoint
orRealChildWindowFromPoint
to get a HWND and then callAccessibleObjectFromWindow
to get aIAccessible
interface and callaccDoDefaultAction
.A less sane option is to use
WM_NCHITTEST
to figure out what the mouse is over and send some fakeWM_NCLBUTTON*
messages.
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
屏幕上的几乎任何东西都是可点击的(除了那些命中测试为HTERROR , HTNOWHERE和HTTRANSPARENT )。 理智的方法是使用UI Automation / MSAA。 调用WindowFromPoint , ChildWindowFromPoint或RealChildWindowFromPoint获取HWND,然后调用AccessibleObjectFromWindow以获取IAccessible接口并调用accDoDefaultAction 。 一个不太理智的选择是使用WM_NCHITT ...
-
在屏幕中查看坐标(View coordinate in Screen)[2024-03-12]
如果调用getX()或getY(),则获得x和y的相对值(相对于调用该调用的视图)。 如果调用getRawX()或getRawY() ,它将为您提供相对于设备屏幕的视图的绝对位置。 您最有可能得到的负值为-260,因为您将ImageView 260拖离了进行调用的视图(可能是屏幕顶部的视图高度为260)。 如果你试图使用getX()或getY()来计算屏幕的中间部分,那么你必须考虑所有视图的所有大小,但我认为你想使用getRawX()和getRawY() If you call getX() or getY ... -
您可以将位置取消投影到世界位置(一个在近平面上,一个在远平面上),并从这些点构造一条光线。 那么你要寻找的世界点就是轴与这条光线的交点。 由于您知道必须存在交叉点,因此仅计算平面的线参数就足够了。 You can unproject the position into world positions (one on the near plane and one on the far plane) and construct a ray from these points. Then the world po ...
-
我想如果您要触摸的坐标是x , y ,您可以尝试在应用程序中执行input tap xy 。 或者您可以尝试通过PC中的adb执行此命令。 I think you can try to execute input tap x y in your app if the coordinate you want to touch is x, y. Or you can try to execute this command through adb in your PC.
-
你觉得太复杂了。 OpenGL告诉您在变量gl_FragCoord构建的片段着色器中的屏幕片段位置。 使用GLSL-1.30或更新版本,您可以使用texelFetch ,您可以直接将gl_FragCoord作为源坐标。 或者您将translate gl_FragCoord用于纹理空间坐标,请参阅https://stackoverflow.com/a/5879551/524368 You're thinking too complicated. OpenGL tells you the on-screen f ...
-
如果您想从subContent的位置获取屏幕位置,请尝试此操作。 [subContent convertPoint:subContentLocalPoint fromView:[UIApplication sharedApplication].keyWindow]; Try this if you want to get screen position from position of subContent. [subContent convertPoint:subContentLocalPoint fro ...
-
尝试这个, int[] location = new int[2]; // must be array of two integer. view.getLocationOnScreen(location); xAxis = location[0]; // yAxis = location[1]; Try This, int[] location = new int[2]; // must be array of two integer. view.getLocationOnScr ...