1) First I set a max number of lines (Programatically by setting "numberOfLines" or in IB setting the "Lines" attribute)
2) Create a "READ MORE" button and set "readMoreClicked" as its action when touched up inside
3)
long numberOfLines = [self _numberOfLinesInNotes];
public class Server {
private RequestQueue mRequestQueue;
private Context context;
private static class Holder {
static final Server INSTANCE = new Server();
}
public static Server getInstance() {
return Holder.INSTANCE;
}
private Server() {
}
public void initialize(Context context) {
this.context = context;
// Instantiate the cache
Cache cache = new DiskBasedCache(context.getCacheDir(), 1024 * 1024); // 1MB cap
// Set up the network to use HttpURLConnection as the HTTP client.
Network network = new BasicNetwork(new HurlStack());
// Instantiate the RequestQueue with the cache and network.
mRequestQueue = new RequestQueue(cache, network);
// Start the queue
mRequestQueue.start();
}
public void getHoroscope(Response.Listener responseListener, Response.ErrorListener errorListener) {
String url = "https://volley-test.herokuapp.com/volley";
JsonObjectRequest jsObjRequest = new JsonObjectRequest
(Request.Method.GET, url, null, new Response.Listener() {
@Override
public void onResponse(JSONObject response) {
Log.d("Server", "Response: " + response.toString());
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d("Server", "Error: " + error.toString());
}
});
mRequestQueue.add(jsObjRequest);
}
}
5) GsonRequest class
public class GsonRequest extends Request {
private final Gson gson = new Gson();
private final Class clazz;
private final Map headers;
private final Response.Listener listener;
/**
* Make a GET request and return a parsed object from JSON.
*
* @param url URL of the request to make
* @param clazz Relevant class object, for Gson's reflection
* @param headers Map of request headers
*/
public GsonRequest(String url, Class clazz, Map headers,
Response.Listener listener, Response.ErrorListener errorListener) {
super(Method.GET, url, errorListener);
this.clazz = clazz;
this.headers = headers;
this.listener = listener;
}
@Override
public Map getHeaders() throws AuthFailureError {
return headers != null ? headers : super.getHeaders();
}
@Override
protected void deliverResponse(T response) {
listener.onResponse(response);
}
@Override
protected Response parseNetworkResponse(NetworkResponse response) {
try {
String json = new String(
response.data,
HttpHeaderParser.parseCharset(response.headers));
return Response.success(
gson.fromJson(json, clazz),
HttpHeaderParser.parseCacheHeaders(response));
} catch (UnsupportedEncodingException e) {
return Response.error(new ParseError(e));
} catch (JsonSyntaxException e) {
return Response.error(new ParseError(e));
}
}
}
This code needs to be in the ViewController that pushed the ViewController in which you want to hide the back text. *If using a TabBarController this code will go there, no in the contained view controller.
Go to your instagram app and click on the "Edit" button. Go to "Security" tab and see if "Disable implicit OAuth" is enabled, if it is, disable it. If it is not enable it, save, disable it and save :)
If setting the UITableView background to a certain color doesn’t seem to work check that in Attributes Inspector the background color is set in the “View” section and not in the “Table View” section
1) Add your custom font into your project , i.e. drag the font file into xCode project.
2) Edit Info.plist: Add a new entry with the key "Fonts provided by application".
3) For each of your files, add the FILE NAME including extention to this array
4) Open the font in Font Book(double click on your font in finder) to see what the real FONT NAME is.
5) yourLabel.font = [UIFont fontWithName:@"FONT NAME" size:SIZE];