我有值的路径,我想制作这个渐变.
这是代码:
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [[UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:171.0/255.0 alpha:0.6] CGColor]);
CGContextSetFillColorWithColor(context, [[UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:171.0/255.0 alpha:0.6] CGColor]);
UIBezierPath *aPath = [UIBezierPath bezierPath];
[aPath moveToPoint:CGPointMake(30.0, 100.0)];
[aPath addLineToPoint:CGPointMake(200.0, 120.0)];
[aPath addLineToPoint:CGPointMake(300, 210)];
[aPath addLineToPoint:CGPointMake(300, 420)];
[aPath addLineToPoint:CGPointMake(30, 420.0)];
[aPath addLineToPoint:CGPointMake(30, 100.0)];
[aPath closePath];
[aPath fill];
Run Code Online (Sandbox Code Playgroud)
有没有指出这个代码的问题?
我创建了一个SherlockFragmentActivity,它有三个ViewPager片段.但是现在我想在NavigationDrawer中使用这个Activity但是我很困惑如何做到这一点.Google+应用有这种实现,但我想知道如何实现这一目标.
NavigationDrawer将具有以下UI元素:
使用导航抽屉是否可以进行这种布局如果是,我应该怎么做.如果没有,我应该怎么做才能在我的应用程序中实现这种导航.
android android-fragments android-viewpager navigation-drawer
我想知道是否有任何的plist属性/办法从最近使用的列表即删除应用程序,在回家按钮,当您双击.
由于iOS 7的新外观,我在应用程序中出于安全原因提出这个问题.提前致谢.
编写一个函数find_longest_word(wordList),它接受一个单词列表并返回列表中最长的单词.如果存在多个最长的单词(即,具有相同的长度),则它应该返回它们中的第一个(即,在列表中的其他之前出现的那个).
编写一个程序,要求用户输入一些由空格分隔的单词(全部在一行中).然后你的程序应该创建一个包含输入单词的列表(你可以在字符串中使用内置的split方法)并输出列表和最长的单词(使用上面的函数).
样品运行:
输入几个单词,我会发现最长的:
敏捷的棕色狐狸跳过了懒狗
输入的单词列表是:
['敏捷的棕色狐狸跳过了懒狗']
列表中最长的单词是:
快
我的代码
def find_longest_word():
lizt=[]
s = input("Please type a sentence and I will out put the longest word. ")
for word in s:
lizt.append(word)
x = max(s.split(), key=len)
print('')
print('The list of words entered is:')
print(lizt)
print(s.split())
print('')
print('The longest word is:')
print(x)
find_longest_word()
Run Code Online (Sandbox Code Playgroud) 我有一个NSMutableArray用n条目.是否有任何简单的方法将其拆分为另一个,NSMutableArray每个都有25个条目.值n可以大于或小于25.