我有一个UIButton,我在Interface Builder中给出了一个属性标题:它有一个特定的字体,字符串的一部分是不同的颜色.
当我加载我的应用程序时,颜色会保留,但应用程序会将字体恢复为系统默认值...
有人经历过这个或知道修复的方法吗?试图避免在代码中设置属性标题.
如果重要,我使用的字体是Open Sans,它在我在代码中指定字体的其他标签上正确显示.
我有一个特定的应用程序,由于导航结构,让我无法使用普通的UINavigationBars与半透明,所以我选择尝试使用iOS8的UIVisualEffectView与模糊.
这个解决方案大部分都有效,但是当这个模糊视图下的UITableView滚动时会出现非常明显的闪烁效果.当图像边缘或彩色矩形在模糊视图下方通过时,会发生大量闪烁.
有没有人经历过这个?有谁知道如何解决这个问题?
我的实现很简单,我将一个UIVisualEffectView拖到我的视图控制器上并将其约束到顶部,左侧和右侧屏幕边界,并添加了64的高度约束.在它下面只是一个带有一些图像和文本的UITableView.
有一些关于此的教程和问题,但我还不够了解如何将它们实现到我的特定应用程序中.我从URL获取JSON注释数据并解析它并在for循环中添加每个注释.我想在每个注释上添加一个链接,以打开地图的方向.
这是我的ViewController.H
#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
#import <MapKit/MapKit.h>
//MAP Setup
@interface ViewController : UIViewController <MKMapViewDelegate>
//map setup
@property (weak, nonatomic) IBOutlet MKMapView *mapView;
@property (nonatomic, strong) NSMutableData *downloadData;
//- (IBAction)refreshTapped:(id)sender;
@end
Run Code Online (Sandbox Code Playgroud)
和我的ViewController.m
- (void)viewDidLoad
{
////////////////////////
//Connection to download JSON map info
////////////////////////
self.downloadData = [NSMutableData new];
NSURL *requestURL2 = [NSURL URLWithString:@"http:OMITTED"];
NSURLRequest *request = [NSURLRequest requestWithURL:requestURL2];
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request delegate:self];
//scroller
[scroller setScrollEnabled:YES];
[scroller setContentSize:CGSizeMake(320,900)];
[super viewDidLoad];
//Map
[self.mapView.userLocation addObserver:self
forKeyPath:@"location"
options:(NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld)
context:nil];
}
- …Run Code Online (Sandbox Code Playgroud) 我是Android的新手 -
我在屏幕上放了一个滚动视图,我只是在里面放了一些文字.我这样做是因为在某些手机上文字会在屏幕上运行.
我遇到的问题是我放在页面上的滚动视图比它所拥有的内容更长 - 手机屏幕越窄,滚动视图就越长.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/app_background"
android:orientation="vertical"
android:padding="10dp" >
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="20"
android:inputType="textMultiLine"
android:lineSpacingExtra="3dp"
android:text="Get ready to melt fat and burn calories with Fit Body Boot Camp's 14 Day Fat Furnace Workout Program! This is a detailed 14 Day Workout plan based on Fit Body Boot Camp's Unstoppable Fitness Formula that has been implemented in close to 300 boot camps worldwide by hundreds of thousands …Run Code Online (Sandbox Code Playgroud)